#include "bits/stdc++.h" using namespace std; #define fastcin {\ cin.tie(0);\ ios::sync_with_stdio(false);\ } #define rep(i, a, b) for(int i = a; i < b; i++) struct Brother { char n; int h, w; bool operator<(const Brother& another) const { if(h!=another.h) { return h > another.h; } if(w!=another.w) { return w < another.w; } return n < another.n; } }; int main() { fastcin; vector b; char name[3] = {'A', 'B', 'C'}; rep(i, 0, 3) { Brother in; in.n = name[i]; cin >> in.h >> in.w; b.push_back(in); } sort(b.begin(), b.end()); rep(i, 0, 3) printf("%c\n", b[i].n); return 0; }