#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; tuple HW[3]; int main() { for (int i = 0; i < 3; i++) { int H, W; cin >> H >> W; get<0>(HW[i]) = H; get<1>(HW[i]) = W; get<2>(HW[i]) = char('A' + i); } sort(HW, HW + 3, [](auto a, auto b) { if (get<0>(a) == get<0>(b)) { return get<1>(a) < get<1>(b); } return get<0>(a) > get<0>(b); }); for (int i = 0; i < 3; i++) { cout << get<2>(HW[i]) << endl; } return 0; }