// Arup Guha
// 9/27/2015
// Solution to 2003 UCF HS Problem: Spaceship

import java.util.*;

public class spaceship {

	// Being lazy - just defining object here.
	private long x;
	private long y;
	private long z;
	private long d;

	public spaceship(long myx, long myy, long myz, long myd) {
		x = myx;
		y = myy;
		z = myz;
		d = myd;
	}

	// Returns the distance squared between this and other.
	public long distsq(spaceship other) {
		return (x-other.x)*(x-other.x) + (y-other.y)*(y-other.y) + (z-other.z)*(z-other.z);
	}

	// Returns true iff this ship can track other.
	public boolean canTrack(spaceship other) {
		return this.distsq(other) <= d*d;
	}

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=0; loop<numCases; loop++) {

			// Read in my spaceship info.
			int x = stdin.nextInt();
			int y = stdin.nextInt();
			int z = stdin.nextInt();
			spaceship me = new spaceship(x,y,z,0);

			int numShips = stdin.nextInt();
			int res = 0;

			// Go through enemy ships.
			for (int i=0; i<numShips; i++) {

				// Create enemy ship object.
				x = stdin.nextInt();
				y = stdin.nextInt();
				z = stdin.nextInt();
				int d = stdin.nextInt();
				spaceship other = new spaceship(x,y,z,d);

				// Add to count if that ship can track me!
				if (other.canTrack(me)) res++;
			}

			// Output result.
			System.out.println("You will be picked up by "+res+" radars.");
		}
	}
}