#!/usr/bin/perl split('',pop);while(@_){print@_,"\n";$x=shift@_;map{$S=$_+$x;$x=$_;$_=$S>9?$S-9:$S}@_}