#include <bits/stdc++.h>
using namespace std;
#define li long long int
#define le long double
#define mod 1000000007
#define maxe 4000000
vector<bool> pu(maxe+1,false);
vector<li> pr;
class dop
{public:
li n,p,k,q,r;
string s,v;
void get();
};
void seive()
{for(li i=2;(i)<=maxe;i++){if(!pu[i]){
    for(li j=(2*i);j<=maxe;j+=i){pu[j]=true;}
    pr.push_back(i);
}
}}
li power(li x,li n)
{li res=1;
while(n>0){if(n&1){res=((res%mod)*(x%mod))%mod;}
n=n>>1;x=((x%mod)*(x%mod))%mod;}return res;}
li inv(li x)
{return power(x,mod-2);}
void dop::get()
{cin>>n;
if(n==1){cout<<9<<endl;return ;}
else if(n==2){cout<<98<<endl;return ;}
s="98";q=9;
for(li i=0;i<n-2;i++){s+=char(48+q);q=(q+1)%10;}cout<<s<<endl;
}
int main()
{ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
li t=1;
cin>>t;
dop obj[t];
//seive();
for(li i=0;i<t;i++){obj[i].get();}
return 0;}