#include typedef long long ll; typedef unsigned long long ull; using namespace std; #define pb push_back int dy[]={0, 0, 1, -1, 1, 1, -1, -1}; int dx[]={1, -1, 0, 0, 1, -1, -1, 1}; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define mp make_pair #define fi first #define sc second pair,int> a[4]; int h[4],w[4]; int main(){ REP(i,3){ scanf("%d%d",h+i,w+i); } REP(i,3){ a[i] = mp(mp(h[i],-w[i]),i); } sort(a,a+3); RREP(i,3){ printf("%c\n",'A' + a[i].sc); } return 0; }