#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

#include<bits/stdc++.h>
#define itn int
#define ll long long
using namespace std;

ll read(){
	ll a=0,b=1;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-')b=-1;c=getchar();}
	while(c>='0'&&c<='9')a=a*10+c-48,c=getchar();
	return a*b;
}

ll a[1000005];

//9
//98
//989
//9890
//989

int main(){
	int t=read();
	while(t--){
		ll n=read(),ans=0;
		if(n==1)puts("9");
		else {
			for(int i=1;i<=n;i++)cout<<(abs(i-2)+8)%10;
			cout<<'\n';
		}
		
	}
	return 0;
}