#include using namespace std; long long gcd(long long x, long long y) { if (y == 0) return x; return gcd(y, x % y); } long long lcm(long long x, long long y) { if (x == 0 || y == 0) return 0; return x / gcd(x, y) * y; } int main() { vector> HW(3); map, char> mp; for (int i = 0; i < 3; i++) { int H, W; cin >> H >> W; HW[i] = pair(H, W); mp[pair(H, W)] = 'A' + i; } sort(HW.begin(), HW.end(), ::greater>()); for (int i = 0; i < 2; i++) { if (HW[i].first == HW[i + 1].first && HW[i].second > HW[i + 1].second) swap(HW[i], HW[i + 1]); } for (int i = 0; i < 3; i++) { cout << mp[HW[i]] << endl; } }