import algorithm, sequtils, strutils

let a, b, c = stdin.readLine.split.map parseInt

var list: seq[tuple[height: int, weight: int, name: string]]
list.add (a[0], a[1], "A")
list.add (b[0], b[1], "B")
list.add (c[0], c[1], "C")

let ans = list.sortedByIt (-it.height, it.weight)

for (_, _, name) in ans:
  echo name