#include using namespace std; using ll = long long; using P = pair; int main() { cin.tie(0); ios::sync_with_stdio(false); vector

v; vector w = {0,1,2}; for (int i = 0; i < 3; i++) { int h, w; cin >> h >> w; v.emplace_back(-h, w); } sort(w.begin(), w.end(), [&](const int& i1, const int& i2){return v[i1] < v[i2];}); string s = "ABC"; for (int i = 0; i < 3; i++) { cout << s[w[i]] << endl; } return 0; }