#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int N = (int)5e5 + 7;
const int INF = (int)1e9 + 7;
using namespace std;
int n, m;
int ans, cnt;
int a[N];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    if (a[i] % 2 == 1) {
      a[i] -= 3;
      cout << '7';
    }
    while (a[i]) {
      cout << '1';
      a[i] -= 2;
    }
    cout << endl;
  }
  exit(0);
}
