a,b,c=input().upper().split();print((''.join([a[0],b[0],c[0]])))
a,*_=zip(*input().upper().split());print(*a,sep='')

a, b, c = input().upper().split()
print(("".join([a[0], b[0], c[0]])))

a, *_ = zip(*input().upper().split())
print(*a, sep="")

-a, b, c = input().upper().split() -print(("".join([a[0], b[0], c[0]]))) +a, *_ = zip(*input().upper().split()) +print(*a, sep="")