package m.shin; import java.util.Map.Entry; import java.util.Scanner; import java.util.TreeMap; public class Con571 { public static void main(String[] args) { Scanner s = new Scanner(System.in); TreeMap hw = new TreeMap<>(); hw.put(s.nextInt() * 1000 + 100 - s.nextInt(), "A"); hw.put(s.nextInt() * 1000 + 100 - s.nextInt(), "B"); hw.put(s.nextInt() * 1000 + 100 - s.nextInt(), "C"); s.close(); for(int i = 0;i < 3;i++){ Entry ent = hw.pollLastEntry(); System.out.println(ent.getValue()); } } }