#include<stdio.h>
#include<string.h>
int N,K,i,t,f,e,j;
char c[20];
int main()
{
	for(;scanf("%d%d",&N,&K),N+K;)
	{
		for(i=0,t=1;t<=N+K;i++,t+=sprintf(c,"%d",i))
		{
			if(t+sprintf(c,"%d",i+1)>=N)
			{
				for(j=0;j<strlen(c);j++)
					if(t+j>=N&&t+j<N+K)
					{
						putchar(c[j]);
					}
			}
		}
		puts("");
	}
	return 0;
}