import Data.Char\x0d main=getLine>>=mapM_ putStrLn.f\x0d f=takeWhile ((>=1).length).iterate g\x0d where g=map (intToDigit.abs.uncurry (-)).(\s->zip s (tail s)).map digitToInt
Note that non-ascii characters in the above source code will be escaped (such as \x9f).