import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(); List list = new ArrayList<>(); int num = 3; for(int i = 0; i < num; i++) { char c = (char)('A' + i); String s = sc.next() + c; list.add(s); } Collections.sort(list); Collections.reverse(list); for(String tmp: list) { System.out.println(tmp.charAt(tmp.length()-1)); } } }