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