puts [gets, gets, gets].map(&:to_i).zip("ABC".chars).sort.reverse.map { |v| v[1] }