#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

const ll INF = 1LL << 30;
ll N, K;

int len(ll x) {
  int res = 0;
  while (x) {
    x /= 10;
    res++;
  }
  return res;
}

ll sumDigitLen(ll x) {
  if (x == 0) return 0;
  ll res = 0;
  for (ll d = 0, pw = 1; ; d++, pw *= 10) {
    if (pw <= x && x < pw * 10) {
      res += (x - pw + 1) * (d + 1);
      break;
    } else {
      res += (pw * 10 - pw) * (d + 1);
    }
  }
  return res;
}


int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  while (cin >> N >> K, N) {
    ll ok = 0, ng = INF;
    while (ng - ok > 1) {
      ll mid = (ok + ng) / 2;
      if (sumDigitLen(mid) < N) ok = mid;
      else ng = mid;
    }

    ll rem = N - 1 - sumDigitLen(ok);
    string s = to_string(ng);
    for (int i = rem; i < s.size(); i++) {
      if (!(i - rem < K)) break;
      cout << s[i];
    }

    ll d;
    K -= s.size() - rem;
    for (d = ng + 1; K - len(d) >= 0; d++) {
      s = to_string(d);
      for (int i = 0; i < s.size(); i++) {
        cout << s[i];
      }
      K -= len(d);
    }

    s = to_string(d);
    for (int i = 0; i < min((ll)s.size(), K); i++) {
      cout << s[i];
    }
    cout << endl;
  }  

  return 0;
}
