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 C++14 (GCC 5.4.1) (judge verdict: Runtime Error)

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
long long a[150]={0, 1ULL,2ULL,3ULL,4ULL,5ULL,6ULL,7ULL,8ULL,9ULL,19ULL,29ULL,39ULL,49ULL,59ULL,69ULL,79ULL,89ULL,99ULL,199ULL,299ULL,399ULL,499ULL,599ULL,699ULL,799ULL,899ULL,999ULL,1999ULL,2999ULL,3999ULL,4999ULL,5999ULL,6999ULL,7999ULL,8999ULL,9999ULL,19999ULL,29999ULL,39999ULL,49999ULL,59999ULL,69999ULL,79999ULL,89999ULL,99999ULL,199999ULL,299999ULL,399999ULL,499999ULL,599999ULL,699999ULL,799999ULL,899999ULL,999999ULL,1999999ULL,2999999ULL,3999999ULL,4999999ULL,5999999ULL,6999999ULL,7999999ULL,8999999ULL,9999999ULL,19999999ULL,29999999ULL,39999999ULL,49999999ULL,59999999ULL,69999999ULL,79999999ULL,89999999ULL,99999999ULL,199999999ULL,299999999ULL,399999999ULL,499999999ULL,599999999ULL,699999999ULL,799999999ULL,899999999ULL,999999999ULL,1999999999ULL,2999999999ULL,3999999999ULL,4999999999ULL,5999999999ULL,6999999999ULL,7999999999ULL,8999999999ULL,9999999999ULL,19999999999ULL,29999999999ULL,39999999999ULL,49999999999ULL,59999999999ULL,69999999999ULL,79999999999ULL,89999999999ULL,99999999999ULL,199999999999ULL,299999999999ULL,399999999999ULL,499999999999ULL,599999999999ULL,699999999999ULL,799999999999ULL,899999999999ULL,999999999999ULL,1999999999999ULL,2999999999999ULL,3999999999999ULL,4999999999999ULL,5999999999999ULL,6999999999999ULL,7999999999999ULL,8999999999999ULL,9999999999999ULL,19999999999999ULL,29999999999999ULL,39999999999999ULL,49999999999999ULL,59999999999999ULL,69999999999999ULL,79999999999999ULL,89999999999999ULL,99999999999999ULL,199999999999999ULL,299999999999999ULL,399999999999999ULL,499999999999999ULL,599999999999999ULL,699999999999999ULL,799999999999999ULL,899999999999999ULL,999999999999999ULL, 1999999999999999ULL, 2999999999999999ULL};
int main(){
	long long k;
	scanf("%lld", &k);
	for(int i = 1; i < k; i++)
		printf("%lld\n", a[i]);
	printf("%lld", a[k]);
return 0;
}