#include <bits/stdc++.h>
using namespace std;
int main() {
  long int i, j, k, a, l;
  long int test;
  cin >> test;
  while (test--) {
    unsigned long long int cnt = 0;
    unsigned long long int sum = 0;
    long int cnt1 = 0, x = 0;
    cin >> a;
    if (a % 2 == 1) {
      cnt1 = 1;
      a -= 3;
    }
    k = a / 2;
    cnt = 1;
    if (cnt1 == 1) cout << 7;
    while (k > 0) {
      cout << 1;
      k--;
    }
    cout << endl;
  }
}
