s=raw_input() a=[0]*len(s) i=-1 while 1:print`a`[1::3];exec'i-=`a[i]`==s[i];'*4;a[i]+=1