using namespace std;
#include<bits/stdc++.h>
#define int long long
#define all(x) x.begin(), x.end()
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

const int N = 2e5+3;

signed main()
{
    IOS;
    int t; cin>>t; while(t--)
    {
		int n; cin>>n;
		vector<int>temp(10);
		for ( int i = 0; i<10; ++i )
			temp[i] = i;

		if (n==1)
		{
			cout<<9<<'\n';
			continue;
		}    	

		if ( n == 2 )
		{
			cout<<98<<'\n';
			continue;
		}

		cout<<"989";

		n-=3;

		for ( int i = 0; i<n; ++i )
			cout<<temp[i%10];

		cout<<'\n';
    }    
}
