import Data.Char main=interact$unlines.(map.map)intToDigit.takeWhile(/=[]).iterate(map abs. \s->zipWith(-)s$tail s).map digitToInt.filter isDigit