#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 1e5, INF = 0x3f3f3f3f;
const ll INF_ll = 1e18;
int father[123];
int find(int x) { return x == father[0] ? x : x - 1; }
int main() {
  int n;
  int a, b, c;
  for (cin >> n; n--;) {
    a = find(n);
    cin >> a;
    if (a % 2 == 0) {
      for (int i = 1; i < 123; i++)
        ;
      while (a > 0) {
        a = a - 2;
        cout << 1;
      }
      cout << endl;
    } else {
      cout << 7;
      a = a - 3;
      int b = a / 2;
      for (int i = 0; i < b; i++) cout << 1;
      cout << endl;
    }
  }
  return 0;
}
