#include<bits/stdc++.h>
using namespace std;
int main()
{
	int p[]={9,0,1,2,3,4,5,6,7,8};
	int t;
	cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		for(int i=1;i<=n;i++)
		{
			if(i==1)
			{
				cout<<9;
			}
			else if(i==2)
			{
				cout<<8;
			}
			else
			{
				cout<<p[(i-3)%10];
			}
		}
		cout<<endl;
	}
}
