loop do
  n, k = gets.split.map(&:to_i)
  break if k == 0
  d = 1
  while n >= (d == 1 ? 10 : 9 * d * 10 ** (d - 1))
    n -= d == 1 ? 10 : 9 * d * 10 ** (d - 1)
    d += 1
  end
  x = (d == 1 ? 0 : 10 ** (d - 1)) + n / d
  a = []
  i = n % d
  until k == 0
    a << x.to_s[i]
    k -= 1
    i += 1
    x, i = x + 1, 0 if i >= x.to_s.size
  end
  puts a * ""
end
