#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
 
#define mp make_pair
#define pi pair<ll,ll>
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007






void solve() {

 
    ll n;
    cin>>n;
    
    
    if(n==1){
        cout<<"9"<<endl;
        return;
    }
    
    if(n==2){
        cout<<"98"<<endl;
        return;
    }
    
    char c = '9';
    string s = "98";
    for(int i=0; i<n-2; i++){
        s+= c;
        c++;
        if(c>'9'){
            c = '0';
        }
    }
    
    cout<<s<<endl;
    
    
}






 
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    int t=1;
     cin>>t;
    for(int i=1; i<=t; i++) {
        // cout<<"Case #"<<i<<": ";
        solve();
    }
}
