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

int main()
{
	ll t;
	cin>>t;

	while(t--)
	{
     
     int n;
     cin>>n;
     int num=9;
     if(n==1)
     	{
     		cout<<num<<endl;
     		continue;
     	}

   for(int i=1;i<=2;i++)
   {
   	cout<<num;
   	num--;

   }
   num+=2;
   for(int j=3;j<=n;j++)
   {
   	if(num==9)
   	{
   		cout<<num;
   		num=0;

   		continue;
   	}
   	else
   		cout<<num;
   	num++;
   }
   cout<<endl;

		

		
}
	return 0;
}