#include <bits/stdc++.h>
using namespace std;
double PI = 3.14159265358979323846;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isprime[1000000];
vector<long long> p;
void init() {
  isprime[0] = true;
  isprime[1] = true;
  for (long long i = 2; i <= 999999; i++) {
    if (isprime[i]) continue;
    p.push_back(i);
    for (long long j = 2; j * i <= 999999; j++) isprime[i * j] = true;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string ans = "";
    if (n % 2 == 1) {
      ans += "7";
      n -= 3;
    }
    while (n > 0) {
      ans += "1";
      n -= 2;
    }
    cout << ans << endl;
  }
  return 0;
}
