#include #include using namespace std; // int max2(int x, int y) { // return x > y ? x : y; // } // int max3(int x, int y, int z) { // x = max2(x, y); // return max2(x, z); // } // int min2(int x, int y) { // return x < y ? x : y; // } // int min3(int x, int y, int z) { // x = min2(x, y); // return min2(x, z); // } struct Brother { int height; int weight; char name; }; Brother betterBrother(Brother a, Brother b) { if (a.height == b.height) { return a.weight < b.weight ? a : b; } return a.height > b.height ? a : b; } Brother worseBrother(Brother a, Brother b) { if (a.height == b.height) { return a.weight > b.weight ? a : b; } return a.height < b.height ? a : b; } int main() { Brother A = { 0, 0, 'A', }; Brother B = { 0, 0, 'B', }; Brother C = { 0, 0, 'C', }; cin >> A.height >> A.weight >> B.height >> B.weight >> C.height >> C.weight; Brother best = betterBrother(A, B); best = betterBrother(best, C); Brother worst = worseBrother(A, B); worst = worseBrother(worst, C); cout << best.name << "\n"; cout << (best.name != 'A' && worst.name != 'A' ? "A" : best.name != 'B' && worst.name != 'B' ? "B" : "C") << "\n"; cout << worst.name << "\n"; int a; cin >> a; return 0; }