import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from operator import itemgetter H = list(map(int,read().split())) data = sorted(zip('ABC', H), key = itemgetter(1), reverse=True) names, _ = zip(*data) print('\n'.join(names))