#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n;
    string s = "";
    if (n % 2 == 0) {
      s += "1";
    } else
      s += "7";
    x = n / 2 - 1;
    for (long long i = 0; i < (x); ++i) s += "1";
    cout << s << "\n";
  }
}
