#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
vector<int> G[maxn], vis(maxn);
int nod, dist, a, b;
void solve() {
  int n;
  cin >> n;
  if (n & 1) {
    if (n >= 3) {
      cout << 7;
      n -= 3;
    }
    while (n >= 2) {
      cout << 1;
      n -= 2;
    }
    cout << '\n';
  } else {
    while (n >= 2) {
      n -= 2;
      cout << 1;
    }
    cout << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
