/*
Nguyen Duc Anh Phuc_Jacke
*/

#include <limits.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <unordered_set>
#include <set>
#include <fstream>
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;


int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	vector<ll> a;
	a.push_back(0);
	ll x = 0;
	a.push_back(9);
	a.push_back(8);
	a.push_back(9);
	for (ll i = 4; i <= 2e5; i++)
	{
		a.push_back(x);
		x++;
		if (x > 9)
		{
			x = 0;
		}
	}
	ll tt;
	cin >> tt;
	while (tt--)
	{
		ll n;
		cin >> n;
		for (ll i=1; i <= n; i++)
		{
			cout << a[i];
		}
		cout << "\n";
	}
	return 0;
}