#include <iostream>
#include <string>
#include <sstream>
using namespace std;
long long a[10]={9};
int main()
{
	long long n,k,i,j,t;
	for (i=1;i<10;i++) a[i]=10*a[i-1];
	while (cin>>n>>k&&n)
	{
		stringstream ss;
		string s;
		i=0;t=1;n--;
		while (n-a[i]*(i+1)>0) {n-=a[i]*(i+1);i++;}
		for (j=0;j<i;j++) t*=10;
		t+=n/(i+1);n%=i+1;
		for (j=t;j<t+k;j++) ss<<j;
		s=ss.str();
		cout<<s.substr(n,k)<<endl;
	}
	return 0;
}