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 <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fbo find_by_order
#define ook order_of_key
#define f first
#define s second
#define pb push_back
#define reset(a,b) memset(a,b,sizeof a);
#define MOD 998244353
#define MID (l+r)/2
#define ALL(x) x.begin(),x.end()
#define debug(x) cout<<#x<<" = "<<(x)<<endl
#define mx 100003
#define pc(x) putchar_unlocked(x);
typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> pbds;
vector<long long>ve,ini,itu;
long long cnt(long long aa){
	long long ret=0;
	while(aa){
		ret+=aa%10;
		aa/=10;
	}
	return ret;
}

int main(){
	for(int i=1;i<=8;i++)ve.pb(i);
	long long now=1;
	for(int i=1;i<=16;i++){
		now=now*10;
		ini.pb(now);
	}
	for(int i=1;i<=9;i++){
		itu.pb(i);
	}
	for(auto i:ini){
		for(auto j:itu){
			ve.pb(i*j-1);
		}
	}
	sort(ALL(ve));
	int k;
	cin>>k;
	for(long long i:ve){
		if(!k)break;
		cout<<i<<endl;
		//debug(i/cnt(i));
		k--;
	}
	assert(k==0);
}