#include <bits/stdc++.h>
using namespace std;
void FILE_OP() {}
const int N = 105;
int n;
int rank1[N], parent[N];
vector<int> adj[N];
void make_set(int v) {
  parent[v] = v;
  rank1[v] = 0;
}
long long int find_set(int v) {
  if (v == parent[v])
    return v;
  else
    v = find_set(parent[v]);
}
void union_set(int a, int b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b) {
    if (rank1[a] < rank1[b]) swap(a, b);
    parent[b] = a;
    if (rank1[a] == rank1[b]) rank1[a]++;
  }
}
int x[N], y[N];
int vis[N];
void dfs(int v) {
  vis[v] = 1;
  for (int i = 0; i < n; ++i) {
    if (vis[i]) {
      continue;
    }
    if (x[i] == x[v] || y[i] == y[v]) {
      dfs(i);
    }
  }
}
void SOLVE() {
  int tt, m, i, j, k, a, b, c, d, l, r;
  cin >> tt;
  while (tt--) {
    cin >> n;
    m = n / 2;
    if (n % 2) m--;
    string s = "";
    if (n - 2 * m) s += '7';
    for (i = 0; i < m; i++) s += "1";
    cout << s << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  FILE_OP();
  SOLVE();
  return 0;
}
