import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; public class Main { public static void main(String[] args) { Data []d = new Data[3]; Scanner scan = new Scanner(System.in); String name[] = {"A", "B", "C"}; for(int i = 0; i < 3; i++) { d[i] = new Data(scan.nextInt(), scan.nextInt(), name[i]); } scan.close(); Arrays.sort(d, new Comparator() { public int compare(Data d1, Data d2) { return d1.getA() - d2.getA(); } }); for(int i = 0; i < 2; i++) { if(d[i].getA() == d[i + 1].getA()) { if(d[i].getB() < d[i + 1].getB()) { int t1 = d[i + 1].getA(); int t2 = d[i + 1].getB(); String s = d[i + 1].getS(); d[i + 1].setAll(d[i].getA(), d[i].getB(), d[i].getS()); d[i].setAll(t1, t2, s); } } } for(int i = 2; i >= 0; i--) { System.out.println(d[i].getS()); } } } class Data{ private int a; private int b; private String s; public Data(int a, int b, String s) { this.a = a; this.b = b; this.s = s; } public int getA() { return a; } public int getB() { return b; } public String getS() { return s; } public void setAll(int a, int b, String s) { this.a = a; this.b = b; this.s = s; } }