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

int main(){
    int t,n;
    cin>>t;
    while(t--){
        cin>>n;
        if(n==1){
            cout<<9<<"\n";
            continue;
        }
        if(n==2){
            cout<<98<<"\n";
            continue;
        }
        if(n==3){
            cout<<989<<"\n";
            continue;
        }
        vector<int> v(n);
        v[0]=9;
        v[1]=8;
        v[2]=9;
        for(int i=3;i<n;i++){
            v[i]=v[i-1]+1;
            v[i]%=10;
        }
        for(int i=0;i<n;i++){
            cout<<v[i];
        }
        cout<<"\n";
    }
}
