// AOJ 2177: Champernowne Constant
// 2017.11.5 bal4u@uu

#include <stdio.h>
#include <string.h>

long long len[11];
int ten[10] = {1};

int main()
{
	int n, k, i, j, num;
	long long nine;
	char buf[200], *p;

	for (nine = 9, i = 1; i <= 10; i++, nine *= 10) len[i] = i*nine, ten[i] = ten[i-1]*10;
	for (i = 1; i <= 10; i++) len[i] += len[i-1];

	while (scanf("%d%d", &n, &k) && n > 0) {
		for (i = 1; len[i] < n; i++);
		j = n - (int)len[i-1] - 1;
		num = j / i + ten[i-1];
		sprintf(buf, "%d", num);
		p = buf + j % i;
		i = strlen(p);
		while (i < k) sprintf(p+i, "%d", ++num), i = strlen(p);
		*(p+k) = 0;
		puts(p);
	}
	return 0;
}