import Data.List
import Data.List.Split

main :: IO ()
main = do
  input <- map (map read . lines) . splitOn "\n\n" <$> readFile "input"
  print $ day1a input
  print $ day1b input

day1a :: [[Int]] -> Int
day1a = maximum . map sum

day1b :: [[Int]] -> Int
day1b = sum . take 3 . reverse . sort . map sum
