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 rec g k n = if n > 9
  then begin
    for i = 1 to 9 do
      printf "%d" i;
      List.iter (printf "%d") (repeat 9 k);
      print_newline ();
    done;
    g (k+1) (n-9)
  end
  else for i = 1 to n do
      printf "%d" i;
      List.iter (printf "%d") (repeat 9 k);
      print_newline ();
    done

let g n = g 0 n

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