import re
import sys

#Lista de Entradas
lst = []
for line in sys.stdin:
    lst.append(line.rstrip("\n"))

#Tranforma tudo em lista de inteiro
regex = [[int(r) for r in re.findall("(\d+)",line)]
            for line in lst]

#Máxima velocidade de cada caso
cases = [max(r[1:]) for r in regex[1:]]

#Imprime
for i in range(0,regex[0][0]):
    print('Case',str(i+1)+":",cases[i])
e5b8c6549394e4b6aef604aac1bda0778e6de648
<mask token>

<mask token>
for line in sys.stdin:
    lst.append(line.rstrip('\n'))
<mask token>
for i in range(0, regex[0][0]):
    print('Case', str(i + 1) + ':', cases[i])

<mask token>
lst = []
for line in sys.stdin:
    lst.append(line.rstrip('\n'))
regex = [[int(r) for r in re.findall('(\\d+)', line)] for line in lst]
cases = [max(r[1:]) for r in regex[1:]]
for i in range(0, regex[0][0]):
    print('Case', str(i + 1) + ':', cases[i])

import re
import sys
lst = []
for line in sys.stdin:
    lst.append(line.rstrip('\n'))
regex = [[int(r) for r in re.findall('(\\d+)', line)] for line in lst]
cases = [max(r[1:]) for r in regex[1:]]
for i in range(0, regex[0][0]):
    print('Case', str(i + 1) + ':', cases[i])

import re
import sys

#Lista de Entradas
lst = []
for line in sys.stdin:
    lst.append(line.rstrip("\n"))

#Tranforma tudo em lista de inteiro
regex = [[int(r) for r in re.findall("(\d+)",line)]
            for line in lst]

#Máxima velocidade de cada caso
cases = [max(r[1:]) for r in regex[1:]]

#Imprime
for i in range(0,regex[0][0]):
    print('Case',str(i+1)+":",cases[i])