#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int N = 1e6 + 9;
void solve() {
  int a, b, n;
  cin >> n;
  if (n == 3)
    cout << 7 << endl;
  else {
    if (n % 2) cout << "7", n -= 3;
    for (int i = 2; i <= n; i += 2) cout << "1";
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  int T = 1, cas = 0;
  cin >> T;
  while (T--) solve();
  return 0;
}
