use List::Util qw/sum/;
my $k = <>; chomp $k;
$sunuke = 1;

$count = 0;
$n=1;
while ($count < $k) {
    my @digit = split //, $n;
    my $s = $n / sum @digit;

    if ($sunuke <= $s) {
        my @next_digit = split //, $n+1;
        my $next_s = ($n+1) / sum @next_digit;

        if ($s <= $next_s) {
            print "$n\n";
            $count++;
            $sunuke = $s;
        }
    }
    $n++;
}

