#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
int INF = INT_MAX / 2;

ll f(ll x) {
	ll d = 1, cnt = 0;
	for (ll y = 9; x > 0; y *= 10)  {
		ll z = min(x, y);
		x -= z;
		cnt += d * z;
		d++;
	}
	return cnt;
}

int main() {
	for (;;) {
		ll N, K; cin >> N >> K;
		if (N == 0 && K == 0) break;
		N--;
		ll lb = 0, ub = N + 1;
		while (ub - lb > 1) {
			ll mid = (lb + ub) / 2;
			if (f(mid) <= N) lb = mid;
			else ub = mid;
		}
		N -= f(lb);
		stringstream ss;
		for (int i = 1; i <= 100; i++)
			ss << (lb + i);
		cout << ss.str().substr(N, K) << endl;
	}
}