package yukicoder; import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; public class No574 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Integer[] h = new Integer[3], w = new Integer[3]; int change; for(int i = 0; i < 3; i++) { h[i] = sc.nextInt() * 100 + 65 + i; w[i] = sc.nextInt(); } Arrays.sort(h, Comparator.reverseOrder()); for(int i = 0; i < 2; i++) { if(h[i] == h[i + 1] && w[i] > w[i + 1]) { change = h[i]; h[i] = h[i + 1]; h[i + 1] = change; } } for(int each : h) { System.out.println((char)(each % 100)); } } }