#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  vector<int> num(t);
  for (int i = 0; i < t; i++) {
    cin >> num[i];
  }
  int a;
  int div;
  int j;
  for (int i = 0; i < t; i++) {
    a = num[i];
    div = a / 2;
    if (a % 2 == 0) {
      for (j = 0; j < div; j++) {
        cout << "1";
      }
      cout << "\n";
    } else {
      cout << "7";
      for (j = 0; j < div - 1; j++) {
        cout << "1";
      }
      cout << "\n";
    }
  }
  return 0;
}
