#include <iostream>
#include <bits/stdc++.h>
#define inf 1000000007
#define ll long long
#define fr first
#define sc second
#define mk make_pair
#define pb push_back
using namespace std;

//fast I/O 
auto optimizer = []() {  // makes I/O fast
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  return 0;
}();

//power mode where (x^y) % p is calculated in log (y) time
int power(ll x, ll y, ll p)  
{  
    int res = 1;
    x = x % p; 
    if (x == 0) return 0;
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}  

//Code -

int main() {
	ll n,i,j,t,m,temp;
    cin >> t;
    for(i = 0; i < t; i++){
        cin >> n;
        if(n == 1){
            cout << 9 << endl;
            continue;
        }
        else if(n == 2){
            cout << 98 << endl;
            continue;
        }
        string str = "989";
        for(j = 0; j < n-3; j++){
            str += ('0' + j%10);
        }
        cout << str << endl;
    }
    return 0;
}