#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  for (cin >> t; t > 0; --t) {
    int n;
    cin >> n;
    if (n == 1) {
      cout << "1337\n";
      continue;
    }
    for (int m = 1000; m > 1; --m) {
      if (n > 0)
        for (int i = 0; i < 2 * n / (m * (m - 1)); ++i) cout << "1";
      n %= ((m * (m - 1)) / 2);
      cout << "3";
    }
    cout << "37\n";
  }
  return 0;
}
