#include #include #include using namespace std; typedef vector Input; Input parse() { Input elves; unsigned elf = 0; for (string line; getline(cin, line);) { if (line.empty()) { elves.push_back(elf); elf = 0; continue; } elf += stoul(line); } sort(elves.begin(), elves.end(), greater()); return elves; } unsigned p1(Input &input) { return input[0]; } unsigned p2(Input &input) { return input[0] + input[1] + input[2]; } int main() { auto input = parse(); cout << p1(input) << endl; cout << p2(input) << endl; }