// Arup Guha
// 2/18/2205
// Solution to Final Individual Contest Problem B: Carrying Power Strips

import java.util.*;

/***
Let a, b, and c be the input values for the case.
Option 1 takes 3a + 2b time
Option 2 takes 2a + a + 2c = 3a + 2c time

So, if      b < c, option 1 is better.
    else if c < b, option 2 is better.
    else    both take the same time
***/

public class carry {

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
		
		// Process cases.
		for (int loop=0; loop<nC; loop++) {
		
			// Get input.
			int a = stdin.nextInt();
			int b = stdin.nextInt();
			int c = stdin.nextInt();
			
			// Output accordingly.
			if (b < c) 		System.out.println("1");
			else if (c < b)	System.out.println("2");
			else			System.out.println("3");
		}
	}
}