#include #include using namespace std; struct H{ int h, w; char name; }; bool operator<(H &a, H &b){ return a.h == b.h ? a.w > b.w : a.h < b.h; } int main(){ H hs[3]; for(int i = 0; i < 3; i++){ int h, w; cin >> h >> w; hs[i].h = h; hs[i].w = w; hs[i].name = "ABC"[i]; } sort(hs, hs + 3); reverse(hs, hs + 3); for(int i = 0; i < 3; i++){ cout << hs[i].name << endl; } return 0; }