#include using namespace std; struct Character { char name; int height; int weight; }; bool cmp(const Character &a, const Character &b) { if (a.height != b.height) { return a.height > b.height; } else { return a.weight < b.weight; } } int main() { vector vt(3); int h, w; for (int i = 0; i < 3; ++i) { cin >> h >> w; vt[i].name = (char) 'A' + i; vt[i].height = h; vt[i].weight = w; } sort(vt.begin(), vt.end(), cmp); for (int i = 0; i < 3; ++i) { cout << vt[i].name << endl; } return 0; }