lst={} for i in 'ABC': lst[i]=int(input()) for j in range(3): print((sorted(lst.items(),key=lambda s:s[1],reverse=True))[j][0] )