#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
const int MAXN = 2e5 + 5;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
void solve() {
  int t;
  cin >> t;
  while (t--) {
    string ans = "";
    int n;
    cin >> n;
    if (n % 2 == 1) {
      ans += "7";
      n -= 3;
    }
    int n2 = n / 2;
    for (int i = 0; i < n2; i++) {
      ans += "1";
    }
    cout << ans << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
