Problem:
Score : 500 points

Problem Statement

Let S(n) denote the sum of the digits in the decimal notation of n.
For example, S(123) = 1 + 2 + 3 = 6.

We will call an integer n a Snuke number when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds.

Given an integer K, list the K smallest Snuke numbers.

Constraints

1 \leq K

The K-th smallest Snuke number is not greater than 10^{15}.

Input

Input is given from Standard Input in the following format:

K

Output

Print K lines. The i-th line should contain the i-th smallest Snuke number.

Sample Input 1

10

Sample Output 1

1
2
3
4
5
6
7
8
9
19

Solution in OCaml (4.02.3) (judge verdict: Wrong Answer)

open Scanf
open Printf

let id a = a
let pair a b = a, b
let triplet a b c = a, b, c

let rec scan_list = function
  | 1 -> scanf "%d" (fun k -> [k])
  | n -> scanf "%d " (fun k -> k :: scan_list (n-1))

let rec s = function
  | 0 -> 0
  | n -> n mod 10 + s (n / 10)

let sunuke n = float_of_int n /. float_of_int (s n)

let rec repeat c = function
  | 0 -> []
  | n -> c :: repeat c (n-1)

let f n = for i = 1 to n do
    printf "%d99\n" i
  done

let g n = if n > 9
  then begin
    for i = 1 to 9 do
      printf "%d9\n" i
    done;
    f (n-9)
  end
  else
    for i = 1 to n do
      printf "%d9\n" i
    done

let h n = if n > 9
  then begin
    for i = 1 to 9 do
      printf "%d\n" i
    done;
    g (n-9)
  end
  else
    for i = 1 to 9 do
      printf "%d\n" i
    done

let () = scanf "%d\n" h