#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

int len(ll x) {
  int l = 1;
  for (x /= 10; x > 0; x /= 10) l++;
  return l;
}
ll pow10(int p) {
  ll r = 1;
  REP(i,p)r*=10;
  return r;
}

int main() {
  ll n,k;
  while(cin>>n>>k,n||k) {
    ll cnt = 1;
    ll d = 9;
    int num = 0;
    int keta;
    for (keta=1; cnt+keta*d<n; ++keta) {
      cnt += keta*d;
      num += d;
      d*=10;
    }
    ll a = pow10(keta-1) + (n-cnt)/keta;
    int c = (n-cnt)%keta;
    stringstream ss;
    for (ll i=a; i<a+k+1; ++i) {
      ss << i;
    }
    string ans = ss.str();
    cout << ans.substr(c,k) << endl;
  }
}