Solve #33 in Haskell.