Solve #66 in Haskell.