/*
 * Lisa Soros
 * BHCSI 2011
 * Programming Contest problem based on the AI elective
 */

import java.util.*;
import java.io.*;

public class bullets
{
	public static void main(String[] args) throws FileNotFoundException
	{
		int numCases, x1, y1, x2, y2, horizontal, vertical;
		
		// Initialize the file scanner
		Scanner fileScanner = new Scanner(new File("bullets.in"));
		numCases = fileScanner.nextInt();
		
		// For each test case
		for(int i=0; i<numCases; i++)
		{	
			// Read in the test data
			x1 = fileScanner.nextInt();
			y1 = fileScanner.nextInt();
			x2 = fileScanner.nextInt();
			y2 = fileScanner.nextInt();
			
			// Calculate the horizontal and vertical differences
			horizontal = x1 - x2;
			vertical = y1 - y2;
			
			// Find the total distance traveled by the bullet (the hypotenuse)
			double distance = Math.sqrt(Math.pow(horizontal, 2)+(Math.pow(vertical, 2)));
			
			// Output to screen
			System.out.println("Bullet shot from ("+ x1+ ", "+ y1+ ").");
			System.out.println("Bullet should hit CardinalBot at ("+ x2+ ", "+ y2+ ").");
			System.out.println("Distance to target: "+ distance+".");
			if(distance>13.0+1e-9)
				System.out.println("The bullet explodes.\n");
			else
				System.out.println("The bullet hits its target.\n");
		}
	}
}
