# read in the number of test cases
t = int(input())
for case_num in range(t):
# get the list of runners
runners = input().split()
fastest = 0
# the first entry runners[0] is actually the number of runners
# so ignore it, i.e. runners[1:] is the list of values we just
# read except for the first one
for val in runners[1:]:
# record the fastest runner seen so far
fastest = max(fastest, int(val))
print("Case " + str(case_num+1) + ": " + str(fastest))