package yukicoder; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class No574 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); HashMap map = new HashMap<>(); for(int i = 0; i < 3; i++) { map.put((char)(65 + i), new Integer[]{sc.nextInt(), sc.nextInt()}); } map.entrySet().stream().sorted( Map.Entry.comparingByValue((hu1, hu2) -> { if(hu1[0] < hu2[0] || hu1[0].equals(hu2[0]) && hu1[1] > hu2[1]) { return 1; } else { return -1; } }) ).forEach(m -> System.out.println(m.getKey())); } }