#ifdef _WIN32
#define getc_unlocked(stdin) getc(stdin)
#endif
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <list>
#include <bitset>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <ctime>
#include <numeric>
#include <functional>
#include <valarray>
#include <complex>
using namespace std;

const int dx[]={0,-1,0,1,-1,1, 1,-1};
const int dy[]={1,0,-1,0, 1,1,-1,-1};
const double eps=1e-8;

typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vgraph;
typedef vector<pii> vpii;
typedef vector<LL> vLL;
typedef vector<string> vs;

#define sz(a) a.size()
#define fori(i,a,b) for(int i(a),_b(b);i<=_b;++i)
#define ford(i,a,b) for(int i(a),_b(b);i>=_b;--i)
#define forn(i,n) fori(i,0,n-1)
#define fora(i,a) forn(i,sz(a))
#define fore(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define all(a) a.begin(),a.end()
#define mp make_pair
#define pb push_back
#define clear0(a) memset(a,0,sizeof(a))
#define clearm1(a) memset(a,-1,sizeof(a))
#define maximum(a) (*max_element(all(a)))
#define minimum(a) (*min_element(all(a)))
#define findx(a,x) (find(all(a),x)-a.begin())
#define two(X) (1LL<<(X))
#define contain(S,X) ((S)&two(X))
#define setbit(S,X) ((S)|=two(X))
#define clearbit(S,X) ((S)&=~two(X))
#define togglebit(S,X) ((S)^=two(X))
#define sqr(a) ((a)*(a))
#define fi "input.inp"
#define fo "output.out"
#define nmax 100
#define mmax 100
#define kmax 10
#define modulo 1000000007
#define maxc 999999999
void go(int fr, int num)
{
    vector<int> a;
    while (num)
    {

        int u = fr++;
        while (!a.empty()) a.clear();
        while(u)
        {
            a.pb(u%10);
            u/=10;
        }
        for(int i = a.size()-1; i >= 0; --i)
        {
            if (num == 0) return;
            printf("%d",a[i]);
            --num;
        }
    }
}
typedef long long int64;
const int64 c[] = {0,9,90,900,9000,90000,900000,9000000,90000000,900000000,9000000000};
const int st[] = {0,1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000};
int main()
{
	#ifndef ONLINE_JUDGE
		//freopen(fi,"r",stdin);
		//freopen(fo,"w", stdout);
	#endif
	int n, k;

	while(1)
    {
        scanf("%d %d", &n, &k);
        if (n == 0 && k == 0) break;
        if (n==0)
        {
            printf("0");
            --k;
        }
        int uu = n, stt, du;
        fori(i, 1, 9)
            if (uu > c[i]*i) uu-=c[i]*i;
            else
            {
                stt = st[i] + uu / i;
                if (uu % i ==0)
                {
                    stt--;
                    du = i;
                }
                else du = uu % i;
                break;
            }
        int temp = stt;
        vector<int> a;
        while (!a.empty()) a.clear();
        while(stt)
        {
            a.pb(stt%10);
            stt/=10;
        }
        for(int i = a.size()-du; i>=0; --i)
        {
            if (k==0) break;
            printf("%d", a[i]);
            --k;
        }
        go(temp+1, k);
        printf("\n");
    }
	return 0;
}

Measured memory_bytes: 1216