s='' t='0123456789' for c in raw_input():i=t.find(c);s+=`i`;t=c+t[:i]+t[i+1:] print s