#include using namespace std; typedef long long ll; int main(void) { ll H,W; char ch = 'A'; vector< pair< pair, char > > tall; for (int i=0; i<3; i++) { cin >> H >> W; tall.push_back(make_pair(make_pair(H, -W), ch++)); } sort(tall.begin(), tall.end()); reverse(tall.begin(), tall.end()); for (auto x:tall) { cout << x.second << endl; } return 0; }