#include using namespace std; int Comp( const int H0, const int W0, const int H1, const int W1 ) { if( H0 < H1 ) return - 1; else if( H0 > H1 ) return 1; if( W0 < W1 ) return 1; else if( W0 > W1 ) return - 1; return 0; } int main() { int HA; int HB; int HC; int WA; int WB; int WC; cin >> HA; cin >> WA; cin >> HB; cin >> WB; cin >> HC; cin >> WC; if( Comp( HA, WA, HB, WB ) > 0 ) { if( Comp( HC, WC, HB, WB ) < 0 ) { cout << "A" << endl; cout << "B" << endl; cout << "C" << endl; return 0; } if( Comp( HA, WA, HC, WC ) > 0 ) { cout << "A" << endl; cout << "C" << endl; cout << "B" << endl; return 0; } else { cout << "C" << endl; cout << "A" << endl; cout << "B" << endl; return 0; } } if( Comp( HC, WC, HB, WB ) > 0 ) { cout << "C" << endl; cout << "B" << endl; cout << "A" << endl; return 0; } if( Comp( HA, WA, HC, WC ) > 0 ) { cout << "B" << endl; cout << "A" << endl; cout << "C" << endl; return 0; } else { cout << "B" << endl; cout << "C" << endl; cout << "A" << endl; return 0; } return 0; }