1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import std.stdio, std.string;

void main() {
    auto t = chomp(readln), s = "0".dup;
    while(s.length < t.length || s <= t) {
        writeln(s);
        
        if(s[0] < '9') {
            s[0]++;
        } else {
            s = "10" ~ s[1 .. $];
        }
    }
}