#include <bits/stdc++.h>
#include <cassert>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<double, double>;
using pld = pair<ld, ld>;


int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

    int t;
    cin >> t;

    while (t--)
    {
        int n;
        cin >> n;

        if (n == 1)
        {
            cout << "9\n";
        }
        else if (n == 2)
        {
            cout << "98\n";
        }
        else
        {
            cout << "989";
            n -= 3;

            int val = 0;
            while (n--)
            {
                cout << val;
                val = (val + 1) % 10;
            }
        }
        cout << "\n";
    }
}
