#include <bits/stdc++.h>
using namespace std;
void solve() {
  map<long long, long long> ma;
  long long n;
  cin >> n;
  string s = "";
  long long repeat = n / 2;
  for (long long i = 0; i < repeat; i++) s += '1';
  if (n % 2) {
    s[0] = '7';
  }
  cout << s << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
}
