#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long int t;
  cin >> t;
  for (long long int ti = 0; ti < t; ++ti) {
    long long int n;
    cin >> n;
    if (n % 2) {
      cout << "7";
      n -= 3;
    }
    while (n) {
      cout << "1";
      n -= 2;
    }
    cout << endl;
  }
  return 0;
}
