while 1:print`[int(d)+3>>i&1for d in`input()`for i in 3,2,1,0]`[1::3]