for i in range(int(input())): print("Case {0}: {1}".format(i+1, sorted(list(map(int, input().split())))[1]))