#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    int x;
    int a;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x;
        int a = 0;
        if (x == 1) {
            cout << 9 << endl; continue;
        } else if (x == 2) {
            cout << 98 << endl; continue;
        } else {
            cout << 989;
            x -= 3;
            for (int j = 0; j < x; j++) {
                cout << a;
                a++;
                if (a == 10) a = 0;
            }
            
        }
        cout << endl;
    }
}