for(;n=readline();){for(n=n.split(""),e=n.map(function(c,i)[i,0,c=="0"]),I=-1;v=e[++I];)l=v[0],r=v[1],h=v[2],h&&[10,-10,1,-1].map(function(o)"-"==n[o+=l]&&e.push([o,r+1,h,n[o]=<>&#{r+(r<9?49:r<35?56:62)};</>]));print(n.join(""))}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).