#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int b = sqrt(2 * n);
    if (b <= 4) {
      for (int i = 0; i < n; i++) cout << "1";
      cout << "337" << endl;
    } else {
      cout << "1";
      for (int i = 0; i < b - 3; i++) cout << "3";
      n = n - b * (b - 1) / 2;
      int x = n / 3;
      for (int i = 0; i < x; i++) cout << "1";
      cout << "3";
      n = n - x * 3;
      for (int i = 0; i < n; i++) cout << "1";
      cout << "337" << endl;
    }
  }
}
