#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; struct ST { char c; int h, w; }; bool operator<(const ST& a, const ST& b){ if(a.h == b.h) return a.w < b.w; return a.h > b.h; } int main(){ vector v; rep(i,3){ ST st; st.c = (char)('A' + i); cin >> st.h >> st.w; v.emplace_back(st); } sort(ALLOF(v)); rep(i,v.size()){ cout << v[i].c << endl; } return 0; }