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

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		if(n>2)
		{
			int temp=9;
			cout<<98;
		for(int i=1;i<=n-2;i++)
		{
			cout<<temp;
			temp++;
			if(temp>9) temp=0;
		}
		cout<<endl;
		}
		else if(n==2){
			cout<<98<<endl;
		}
		else {
			cout<<9<<endl;
		}
		
	}
}