#include <iostream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b;
        cin>>a;
        if(a==1) cout<<9;
        else if(a==2) cout<<98;
        else
        {
            cout<<989;
            b=a-3;
            while(b--)
                cout<<abs((a-b-4)%10);
        }
        cout<<endl;
    }
}
