#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long INF = 1ll * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 7;
const long long MOD2 = 998244353;
const long long N = 5000 * 100 + 1;
const long long N2 = 1000 * 1000 + 5;
const long double PI = 3.14159265;
const long long R = 250;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x %= p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    if (n % 2 == 0) {
      for (int i = 0; i < n / 2; i++) {
        cout << 1;
      }
    } else {
      cout << 7;
      n = n - 3;
      if (n) {
        for (int i = 0; i < n / 2; i++) {
          cout << 1;
        }
      }
    }
    cout << "\n";
  }
  return 0;
}
