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

 



 int main(){	

   ios_base::sync_with_stdio(false);
   cin.tie(NULL);

  #ifndef ONLINE_JUDGE
    
   freopen("input.txt", "r", stdin);
   
   freopen("output.txt", "w", stdout);
  #endif

   ll t;
   cin>>t;
   while(t--){
   	ll n;
   	cin>>n;
   	if(n==1)cout<<"9\n";
   	else if(n==2)cout<<"98\n";

   	else{
   		cout<<"98";
   		int x=9;
   		for(int i=0;i<n-2;i++){
   			cout<<x;
   			x++;
   			x%=10;
   		}
   		cout<<"\n";
   	}
   }

	  


  
   return 0;
   		


}