begin repeat var i,k,n:comp=0;read(k);repeat i:=i+1;k:=k div i;n:=n+k mod(i+1)*10pow i until k=0;writeln(n)until 0>0end.