import java.util.Arrays; import java.util.Scanner; public class Main { public static long MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); // pair があれば楽にできるのに final long A = sc.nextLong(); final long B = sc.nextLong(); final long C = sc.nextLong(); final long max = Math.max(A, Math.max(B, C)); final long min = Math.min(A, Math.min(B, C)); if(max == A){ if(min == B){ System.out.printf("%s\n%s\n%s\n", "A", "C", "B"); }else{ System.out.printf("%s\n%s\n%s\n", "A", "B", "C"); } }else if(max == B){ if(min == A){ System.out.printf("%s\n%s\n%s\n", "B", "C", "A"); }else{ System.out.printf("%s\n%s\n%s\n", "B", "A", "C"); } }else{ if(min == A){ System.out.printf("%s\n%s\n%s\n", "C", "B", "A"); }else{ System.out.printf("%s\n%s\n%s\n", "C", "A", "B"); } } } }