import java.io.*; import java.util.*; public class Main_yukicoder571 { private static Scanner sc; private static Printer pr; private static void solve() { List hw = new ArrayList<>(); for (int i = 0; i < 3; i++) { int h = sc.nextInt(); int w = sc.nextInt(); hw.add(new Pair(h, w, (char)('A' + i))); } Collections.sort(hw); for (Pair e : hw) { pr.println(e.c); } } private static class Pair implements Comparable { int a; int b; char c; Pair(int a, int b, char c) { this.a = a; this.b = b; this.c = c; } @Override public int compareTo(Pair o) { if (a == o.a) { return Integer.compare(b, o.b); } return Integer.compare(o.a, a); } @Override public int hashCode() { return Integer.hashCode(a); } @Override public String toString() { // [xxx, xxxx] StringBuilder stmp = new StringBuilder(32); stmp.append('['); stmp.append(a); stmp.append(','); stmp.append(' '); stmp.append(b); stmp.append(']'); return stmp.toString(); } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }