s=raw_input() while s:print"".join(s);x=map(int,s);s=[`abs(a-b)`for a,b in zip(x,x[1:])]