a=[*$<];puts %w[A B C].sort_by{-a.to_i.shift}