#include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { string s = "ABC"; vector, char>> v; for (int i = 0; i < 3; ++i) { int a, b; cin >> a >> b; v.push_back({{ a,b }, s[i]}); } sort(v.begin(), v.end(), [&](pair, char> a, pair, char> b) { if (a.first.first!=b.first.first) { return a.first.first > b.first.first; } else { return a.first.second < b.first.second; } }); for (auto p:v) { cout << p.second << endl; } return 0; }