s,k;main(n){for(scanf("%d%d",&n,&k);s+81;s--)s%9?fflush(0):printf("%d\n",s*~k+~-n%~k);}