n=int(input()) arr=[] for i in range (n): res="" for j in input().split(): res+=j[0].upper() arr.append(res) for i in arr: print(i)