input = STDIN.read.split "\n\n"
elves = input.map { |elf| elf.split("\n").map(&:to_i).sum }.sort
puts "Part 1: #{elves.last}"
puts "Part 2: #{elves.last(3).sum}"