#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  for (int q = 0; q < t; q++) {
    cin >> n;
    if (n % 2) {
      n -= 3;
      cout << 7;
    }
    while (n > 0) {
      n -= 2;
      cout << "1";
    }
    cout << "\n";
  }
}
