#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;

int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;cin>>n;
    int half = n/2;
    int a[10] = {0,1,2,3,4,5,6,7,8,9};
    if(n==1)
    cout<<9;
    else if(n==2)
    cout<<98;
    else if(n == 3)
    cout<<989;
    else
    {
        cout<<989;
        for(int i=0;i<n-3;i++)
        cout<<a[i%10];
    }
    cout<<endl;
  }
}