import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        String[] inputs = in.nextLine().split(",");
        int a = Integer.parseInt(inputs[0]);
        int b = Integer.parseInt(inputs[1]);
        int c = Integer.parseInt(inputs[2]);

        int value = a ^ b ^ c;

        if (value == 0) {
            System.out.println(1);
        } else {
            if ((a ^ value) < a) {
                System.out.println("A," + (a - (a ^ value)));
            } else if ((b ^ value) < b) {
                System.out.println("B," + (b - (b ^ value)));
            } else if ((c ^ value) < c) {
                System.out.println("C," + (c - (c ^ value)));
            }
        }
        in.close();
    }
}