i=0 for c in input():i+=44-ord(c);print(end="0*12345"[i%9])