import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;


void main() {
    long[] a;

    foreach (i ; 1 .. 10) {
        a ~= i;
    }

    foreach (i ; 1 .. 10) {
        a ~= i * 10 + 9;
    }

    foreach (i ; 1 .. 10) {
        a ~= i * 100 + 99;
    }

    foreach (d ; 2 .. 10) {
        foreach (i ; 10 .. d*10) {
            a ~= i * 10L^^d + (10L^^d - 1);
        }

        foreach (i ; d .. 10) {
            a ~= i * 10L^^(d+1) + (10L^^(d+1)- 1);
        }
    }

    foreach (d ; 11 .. 17) {
        a ~= 10L^^d - 1;
    }

    a.sort();

    debug {
        a.writeln;
    }

    int k;
    scan(k);

    writefln("%(%s\n%)", a.take(k));
}


































void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
