#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)

typedef long long ll;

ll topnum(ll x)
{
	ll ret = 0;

	ll a = 1;
	ll b = 10;
	while (b <= x)
	{
		ret += (b - 1LL - b / 10LL + 1LL) * a;
		a++;
		b *= 10LL;
	}
	b /= 10LL;

	ret += (x - b) * a + 1;

	return ret;
}

int main()
{
	/*cout << topnum(1) << endl;
	cout << topnum(10) << endl;
	cout << topnum(11) << endl;
	cout << topnum(1000000) << endl;
	cout << topnum(1000001) << endl;
	cout << topnum(1000001) << endl;
	return 0;*/

	while (1)
	{
		ll K, N; cin >> N >> K;
		if (K == 0) return 0;

		ll l = 1, r = 1;
		rep(i, 0, 10) r *= 10;
		while (l + 1 != r)
		{
			ll mid = (l + r) / 2LL;
			if (N < topnum(mid))
				r = mid;
			else
				l = mid;
		}

		ll top = topnum(l);
		bool init = true;
		string ans = "";
		while (ans.length() < K)
		{
			string s = to_string(l);
			if (init)
			{
				ans += s.substr(N - top);
				init = false;
			}
			else
			{
				ans += s;
			}
			l++;
		}

		rep(i, 0, K) cout << ans[i];
		cout << endl;
	}
}