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

int main()
{
    int T;
    
    cin>>T;
    
    for(int i=1;i<=T;i++)
    {
        int n,count=1;
        cin>>n;
        
        vector<int> a;
        
        if(n==1)
       {
           a.push_back(9);
       }
       else if(n==2)
       {
           a.push_back(9);
           a.push_back(8);
       }
       else if(n==3)
       {
           a.push_back(9);
           a.push_back(8);
           a.push_back(9);
       }
       else
       {
           a.push_back(9);
           a.push_back(8);
           a.push_back(9);
            count=3;
            while(count<=n)
            {
                for(int i=0;i<=9;i++)
                {
                    if(count>n)
                        break;
                    a.push_back(i);
                    //mul=mul*10;
                    count++;
                }
            }
       }
       for(int i=0;i<n;i++)
       {
           cout<<a[i];
       }
       
       cout<<endl;
        
    }
    
    return 0;
}