brothers = [input() for i in range(3)] brothers_map = {brothers[0]: "A", brothers[1]: "B", brothers[2]: "C"} brothers.reverse() for i in brothers: print(brothers_map[i])