#44915: python one line


x__1 (^_^ 809-34)


for _ in range(int(input())):print(f'Case {_+1}: {sorted(list(map(int,input().split())))[1]}')