import java.util.Scanner; public class Main { public static void main(String[] args) { new Main(); } public Main() { try (Scanner sc = new Scanner(System.in)) { int T = sc.nextInt(); while((T--) > 0) { int A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(); int a, b, c; int INF = 2_000_000_000; int cost = INF; if (C > 1 && B > 2) { // 1. A 1 && B > 2) { // 2. C 1 && C > 2) { // 3. B 1 && A > 2) { // 4. B