#include <bits/stdc++.h>
using namespace std;
int modi = 1e9 + 7;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return !b ? a : gcd(b, a % b);
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    string str = "";
    if (x % 2 == 1) {
      str += '7';
      x -= 3;
    }
    while (x > 1) {
      str += '1';
      x -= 2;
    }
    cout << str << endl;
  }
  return 0;
}
