k=0 for c in input():k-=ord(c)*2%5-1;print([k,c][c<"0"],end="")