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