#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 100005;
int prime[1100000], primesize;
bool isprime[11000000];
long long f[N], invf[N];
void getlist(int listsize) {
  memset(isprime, 1, sizeof(isprime));
  isprime[1] = false;
  for (int i = 2; i <= listsize; i++) {
    if (isprime[i]) prime[++primesize] = i;
    for (int j = 1; j <= primesize && i * prime[j] <= listsize; j++) {
      isprime[i * prime[j]] = false;
      if (i % prime[j] == 0) break;
    }
  }
}
long long fpow(long long a, long long k) {
  long long res = 1;
  while (k) {
    if (k & 1) res = (res * a) % mod;
    k >>= 1;
    a = a * a % mod;
  }
  return res;
}
void init(int n) {
  f[0] = 1;
  for (int i = 1; i <= n; ++i) {
    f[i] = f[i - 1] * i % mod;
  }
  invf[n] = fpow(f[n], mod - 2);
  for (int i = n - 1; i >= 0; --i) {
    invf[i] = invf[i + 1] * (i + 1) % mod;
  }
}
long long C(int n, int k) {
  if (k < 0 || k > n) return 0;
  return f[n] * invf[k] % mod * invf[n - k] % mod;
}
void solve() {
  long long n;
  cin >> n;
  if (n == 3) {
    cout << 7 << endl;
  } else {
    if (n % 2) {
      cout << 7;
      n -= 3;
    }
    while (n >= 2) {
      n -= 2;
      cout << 1;
    }
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
