#include using namespace std; typedef long long ll; // #define DEBUG int main() { #ifdef DEBUG cout << "DEBUG MODE" << endl; ifstream in("input.txt"); //for debug cin.rdbuf(in.rdbuf()); //for debug #endif int h, w; tuple person[3]; for (int i = 0; i < 3; i++){ cin >> h >> w; person[i] = make_tuple(-h, w, 'A' + i); } sort(person, person + 3); for (auto x : person) cout << get<2>(x) << endl; return 0; }