#include using namespace std; bool comp (const pair, char> x, const pair, char> y) { if(x.first.first != y.first.first) { return x.first.first < y.first.first; } else { return x.first.second > y.first.second; } } int main() { ios::sync_with_stdio(false); cin.tie(0); vector, char>> a; for(int i = 0; i < 3; i++) { int x, y; cin >> x >> y; a.push_back({{x, y}, i + 'A'}); } sort(a.rbegin(), a.rend(), comp); for(int i = 0; i < 3; i++) { cout << a[i].second << endl; } return 0; }