Solve #26 in Haskell.