A = gets.to_i B = gets.to_i C = gets.to_i list = [['A', A], ['B', B], ['C', C]].sort_by { |_, h| -h } puts list.map(&:first)