#include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while (T--) { int K; cin >> K; if (K < 18) { cout << K / 2 + 1 << '0' << (K - 1) / 2 << '\n'; } else { int n = K / 9, m = K % 9; cout << m + 1; cout << (m == 8 ? "089" : "908"); for (int i = 0; i < n - 4; i++) { cout << "9"; } cout << '\n'; } } }