loop {
	s, k = gets.split.map &:to_i
	break if s == 0
	
	n = 0
	step = 1
	digit = 1
	stack = []
	start = 0
	
	loop {
		over = false
		(start..9).each{|k|
			f = -> d {(n + step) / d - n / d}
			addition = digit * step
			
			if s <= addition
				stack << k
				over = true
				start = 0
				break
			else
				s -= addition
				n += step
				start = 1
			end
		}
		
		if over
			step /= 10
			break if step == 0
		else
			step *= 10
			digit += 1
		end
	}
	
	x = stack.join.to_i + 1
	str = (x..x+99).to_a.join
	puts str[s-1..s+k-2]
}