# coding: utf-8 # Your code here! N=int(input()) for _ in range(N): A,B,C=map(int,input().split()) if A==B and B==C: if A>2: print(3) else: print(-1) continue ans=0 if (B>A and B>C) or (B