for n in range(1001):r=d=0;exec"d+=1;r+=n%d*10**~-d;n/=d;"*7;print r