#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll len(ll x){
  ll a=1,k=0,j=1;
  while(a*10<=x) k+=9*a*j,a*=10,j++;
  k+=(x-a+1)*j;
  return k;
}
int main(){
  ll n,k;
  while(cin>>n>>k,n||k){
    ll l=0,r=1000000000LL,m,i;
    string s;
    while(l+1<r) (len(m=(l+r)/2)<n)?l=m:r=m;
    for(i=1;i<100;i++) s+=to_string(l+i);
    for(i=0;i<k;i++) cout << s[n-len(l)-1+i];
    cout << endl;      
  }
  return 0;
}