#include #define rep(i,n) for(int i=0;i<(int)(n);i++) using namespace std; using ll = long long ; using P = pair ; using pll = pair; constexpr int INF = 1e9; constexpr long long LINF = 1e17; constexpr int MOD = 1000000007; struct brother{ int h,w,id; }; int main(){ vector ans = {'A','B','C'}; vector t(3); rep(i,3){ cin >> t[i].h >> t[i].w; t[i].id = i; } sort(t.begin(),t.end(),[](const brother &l,const brother &r){ if(l.h==r.h) return l.w < r.w; else return l.h > r.h; }); rep(i,3) cout << ans[t[i].id] << endl; return 0; }