import sequtils,strutils,algorithm var A = newSeq[tuple[a : char, b : int, c : int]](3) i : int for c in 'A'..'C': A[i].a = c (A[i].b, A[i].c) = stdin.readline.split.map(parseInt) i += 1 A = A.sortedByIt((-it.b, it.c)) for a in A: echo a.a