by@moratorium08
WA
684ms
{؛1+()ɹɐɥɔʇǝƃ=X((0:,0,+W/X¿W⅋X)ɹɐɥɔʇnd؛X=W؛)ɹoɟ}(W'X)uıɐɯ
main(X,M){for(;M=X;putchar(X&M?X/M+'0':0))X=getchar()+1;}
30123456789781748382695915849458256054719386154526320340789198765432104828091438560394952379275769867