#include <iostream>

void solve()
{
	int n;
	scanf("%d", &n);
	if (n == 1) {
		printf("9\n");
	} else if (n == 2) {
		printf("98\n");
	} else {
		printf("989");
		for (int i = 3; i < n; i++) {
			printf("%d", (i - 3) % 10);
		}
		printf("\n");
	}
}

int main()
{
	int t;
	scanf("%d", &t);
	while (t--) {
		solve();
	}
}
