using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using STR = System.String;
using INT = System.Int32;
using DEC = System.Double;

class Program
{
    public static IO IO = new IO();

    public class DATA
    {
        public INT index;
        public INT h;
        public INT w;
        public DATA(INT INDEX, INT H, INT W)
        {
            index = INDEX; h = H; w = W;
        }
        public int Compare(DATA y)
        {
            int ret = 1;
            if (h > y.h)
            {
                ret = -1;
            }
            else if (h == y.h)
            {
                if (w < y.w)
                {
                    ret = -1;
                }
            }
            return ret;
        }
    }
    static void Main(string[] args)
    {
        INT[][] abc = IO.I(3, ' ');
        DATA[] DATALIST = new DATA[3];
        char[] o = new char[3] { 'A', 'B', 'C' };
        for (int i = 0; i < 3; i++)
        {
            DATALIST[i] = new DATA(i, abc[i][0], abc[i][1]);
        }
        Array.Sort(DATALIST, (x, y) => x.Compare(y));
        for (int i = 0; i < 3; i++)
        {
            IO.W(o[DATALIST[i].index]);
        }
        IO.F();
    }
}

public class IO
{
    private const int WMAX = 1000;
    private StringBuilder SB = new StringBuilder();
    private T R<T>(Func<STR, T> f) { return f(Console.ReadLine()); }
    private T[] R<T>(Func<STR, T> f, char c) { return S().Split(c).Select(f).ToArray(); }
    private T[] R<T>(Func<STR, T> f, INT l) { T[] r = new T[l]; for (INT i = 0; i < l; i++) { r[i] = R(f); } return r; }
    private T[][] R<T>(Func<STR, T> f, INT l, char c) { T[][] r = new T[l][]; for (INT i = 0; i < l; i++) { r[i] = R<T>(f, c); } return r; }
    private void W<T>(Func<T, STR> f, T v, bool lf = true) { SB.Append(f(v)); if (lf) { SB.Append('\n'); } if (SB.Length >= WMAX) { F(); } }
    public STR S() { return R(s => s); }
    public STR[] S(char c) { return R(s => s, c); }
    public STR[] S(INT l) { return R(s => s, l); }
    public STR[][] S(INT l, char c) { return R(s => s, l, c); }
    public INT I() { return R(INT.Parse); }
    public INT[] I(char c) { return R(INT.Parse, c); }
    public INT[] I(INT l) { return R(INT.Parse, l); }
    public INT[][] I(INT l, char c) { return R(INT.Parse, l, c); }
    public DEC D() { return R(DEC.Parse); }
    public DEC[] D(char c) { return R(DEC.Parse, c); }
    public DEC[] D(INT l) { return R(DEC.Parse, l); }
    public DEC[][] D(INT l, char c) { return R(DEC.Parse, l, c); }
    public void W(object s, bool lf = true) { W(v => v.ToString(), s, lf); }
    public void F() { Console.Write(SB); SB.Length = 0; }
}