// Arup Guha
// 5/28/2019
// Solution to 2018 UCF Locals Problem: Alex is Right

import java.util.*;

public class alex_arup {

	// I needed two epsilons to get this to work...
	final public static double EPS = 1e-8;
	final public static double ANGLE_EPS = 1e-5;
	final public static double R = 6371.0;
	
	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		
		// Process each case.
		for (int loop=0; loop<n; loop++) {
			
			// Get original input.
			double[] start = new double[2];
			for (int i=0; i<2; i++)
				start[i] = stdin.nextDouble()*Math.PI/180;
			
			double[] end = new double[2];
			for (int i=0; i<2; i++)
				end[i] = stdin.nextDouble()*Math.PI/180;			
			
			// Convert points to Cartesian and get the closer one to the North Pole.
			double res = 100000;
			double[] pt1 = getPt(start);
			double[] pt2 = getPt(end);
			res = Math.min(res, toNorthPole(pt1));
			res = Math.min(res, toNorthPole(pt2));
			
			// Plane equation with the two points.
			double[] abc = cross(pt1, pt2);
			double d = 0;
			for (int i=0; i<3; i++)
				d += pt1[i]*abc[i];
			
			// Central angle between the two points.
			double cAngle = Math.acos(dot(pt1, pt2)/R/R);
			
			// This is the peak point of the intersection between the plane of the great circle and the sphere of Earth.
			double[] peak = maxZ(abc[0], abc[1], abc[2], d);
			
			// Now, we measure the central angle from pt1 to peak plus pleak to pt2.
			double cAngle1 = Math.acos(dot(pt1,peak)/R/R);
			double cAngle2 = Math.acos(dot(pt2,peak)/R/R);
			
		
			// If the sum of two angles is really close, this means the "peak" is on the flight path.
			if (Math.abs(cAngle-cAngle1-cAngle2) < ANGLE_EPS) {
				System.out.println("Alex");
				System.out.printf("%.6f\n", toNorthPole(peak));
			}
			
			// If not, then one of the two end points is closer.
			else {
				System.out.println("Timothy");
				System.out.printf("%.6f\n", res);
			}
			System.out.println();
		}
	}
	
	// Returns the dot product of v1 and v2.
	public static double dot(double[] v1, double[] v2) {
		double res = 0;
		for (int i=0; i<v1.length; i++)
			res = res + (v1[i]*v2[i]);
		return res;
	}
	
	// Returns the distance rom pt to the North Pole.
	public static double toNorthPole(double[] pt) {
		return Math.sqrt(pt[0]*pt[0] + pt[1]*pt[1] + (R-pt[2])*(R-pt[2]));
	}
	
	// Binary searches the maximum value for z on this plane that intersects the earth.
	public static double[] maxZ(double a, double b, double c, double d) {
		
		// Tricky case!
		if (Math.abs(c) < EPS) return new double[]{0,0,R};
		
		// Safe beginning parameters.
		double low = -R, high = R, bestZ = -R;
		double[] res = null;
		
		// I probably don't need 150 iterations...
		for (int i=0; i<150; i++) {
			
			// Try it!
			double mid = (low+high)/2;
			double[] tmp = canDoZ(a,b,c,d,mid);
			
			// This works, update our best answer if we need to.
			if (tmp != null) {
				low = mid;
				if (mid > bestZ) {
					res = tmp;
					bestZ = mid;
				}
			}
			
			// Doesn't work...
			else
				high = mid;
		}
		
		// Ta da!
		return res;
	}
	
	// Returns true iff ax+by+cz = d has an intersection on the sphere with the given z value z.
	public static double[] canDoZ(double a, double b, double c, double d, double z) {
		
		// Helpful constants given that we know z.
		double axby = d - c*z;
		double x2y2 = R*R - z*z;
		
		// This is for floating point stability. I want to divide by a bigger value and I can either
		// solve for x or y, so here I divide by a to substitute for x and solve for y first.
		if (Math.abs(b) < Math.abs(a)) {
			
			// Corresponding quadratic, when we plug into x^2 + y^2 + z^2 = R^2
			double qa = 1 + b*b/a/a;
			double qb = -2*b*axby/a/a;
			double qc = axby*axby/a/a - x2y2;
			double disc = qb*qb - 4*qa*qc;
		
			// No solution.
			if (disc < -EPS) return null;
			if (disc < 0) disc = 0;
		
			// If disc > 0 there are two points, but for the peak it doesn't matter whether I do + or -.
			double y = (-qb + Math.sqrt(disc))/(2*qa);
			double x = (d - c*z - b*y)/a;
			double[] res = new double[3];
			res[0] = x; res[1] = y; res[2] = z;
			return res;
			
		}
		
		// Here we substitute for y and solve for x.
		else {
			
			// In this case, here is the corresponding quadratic, mostly a and b swap places.
			double qa = 1 + a*a/b/b;
			double qb = -2*a*axby/b/b;
			double qc = axby*axby/b/b - x2y2;
			double disc = qb*qb - 4*qa*qc;
		
			// No solution.
			if (disc < -EPS) return null;
			if (disc < 0) disc = 0;
		
			// Now we can solve for this point. At the peak, it doesn't matter.
			double x = (-qb + Math.sqrt(disc))/(2*qa);
			double y = (d - c*z - a*x)/b;
			double[] res = new double[3];
			res[0] = x; res[1] = y; res[2] = z;
			return res;			
		}
	}
	
	// These formulas were in the problem statement.
	public static double[] getPt(double[] angles) {
		double[] res = new double[3];
		res[0] = R*Math.cos(angles[0])*Math.cos(angles[1]);
		res[1] = R*Math.cos(angles[0])*Math.sin(angles[1]);
		res[2] = R*Math.sin(angles[0]);
		return res;
	}
	
	// Returns a cross product of v1 and v2.
	public static double[] cross(double[] v1, double[] v2) {
		double[] res = new double[3];
		res[0] = v1[1]*v2[2] - v2[1]*v1[2];
		res[1] = v1[2]*v2[0] - v2[2]*v1[0];
		res[2] = v1[0]*v2[1] - v2[0]*v1[1];
		return res;
	}
}
