#include <bits/stdc++.h>
using namespace std;
long long q, n, x;
signed main() {
  cin >> q;
  while (q--) {
    cin >> n;
    x = (1 + sqrt(1 + 8 * n)) / 2;
    cout << "133";
    for (long long i = 0; i < n - (x * x - x) / 2; ++i) cout << '7';
    for (long long i = 0; i < x - 2; ++i) cout << '3';
    cout << "7\n";
  }
}
