K = gets.to_i

geta = 0
k = K
base = 1

memo = Hash.new(-Float::INFINITY)
min_s = Float::INFINITY
list = 100.downto(1).map do |s|
  v = s / s.to_s.chars.map(&:to_i).inject(:+).to_f
  min_s = v if min_s > v
  memo[s] = min_s
  [s, v]
end

def get_snuke_num(digit)
  res = []
  base = 10 ** (digit - 2)
  geta = ('9' * (digit - 2)).to_i

  min_s = Float::INFINITY

  99.downto(10) do |i|
    s = i * base + geta
    v = s / s.to_s.chars.map(&:to_i).inject(:+).to_f
    next if min_s < v
    min_s = v

    res << s
  end

  res.reverse
end

snuke_nums = [*1..9]

keta = 2
while snuke_nums.size <= K
  snuke_nums += get_snuke_num(keta)
  keta += 1
end

puts snuke_nums.take(K)

exit

list.sort_by! { |s, v| [v, s] }.take(100)

max_s = 0

list.each do |s, v|
  next if memo[s] < v
  puts [s, v].join(' ')
end

exit

loop do
  (1..9).each do |i|
    s = i * base + geta
    p [s, s / s.to_s.chars.map(&:to_i).inject(:+).to_f]

    k -= 1
    exit if k == 0
  end

  geta += 9 * base
  base *= 10
end
