#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_M = 12;

/* typedef */

typedef long long ll;

/* global variables */

ll n;
int k;
ll ns[MAX_M + 1], ts[MAX_M + 1];

/* subroutines */

/* main */

int main() {
  ns[0] = 0;
  ll t = 9;
  for (int m = 1; m <= MAX_M; m++, t *= 10) {
    ns[m] = ns[m - 1] + t * m;
    //printf("ns[%d] = %lld\n", m, ns[m]);
  }

  ts[0] = 0, ts[1] = 1;
  for (int m = 2; m <= MAX_M; m++) ts[m] = ts[m - 1] * 10;

  for (;;) {
    cin >> n >> k;
    if (n == 0) break;
    n--;
    
    int m;
    for (m = 1; m <= MAX_M && n >= ns[m]; m++);
    //printf("m=%d,n=%lld\n", m, n);

    stringstream ss;

    ll n0 = (n - ns[m - 1]) / m + ts[m];
    int i0 = (n - ns[m - 1]) % m;
    int len = 0;
    //printf("n0=%lld, m=%d, i0=%d\n", n0, m, i0);
    
    while (len < k + i0) {
      ss << n0;
      len += m;
      n0++;
      if (n0 >= ts[m] * 10) m++;
    }    
    cout << ss.str().substr(i0, k) << endl;
  }

  return 0;
}