Solve #52 in Haskell.