#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <list>
#include <cmath>
using namespace std;
using lol = long long;

int main()
{
    //freopen("inp.txt", "r", stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t, n, pre, a;
    cin >> t;
    while (t--)
    {
        cin >> n;
        if (n == 1)
            cout << 9;
        else
        {
            cout << 98;
            pre = 8;
            n -= 2;
            while (n--)
            {
                pre += 1;
                if (pre == 10)
                    pre = 0;
                cout << pre;
            }
        }
        cout << '\n';
    }
}
