_=map(int,raw_input()) while _:print`_`[1::3];_=[abs(x-y)for x,y in zip(_,_[1:])]