#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int d = n / 2;
    int k = 1;
    if (n % 2) k = 7;
    cout << k;
    d--;
    while (d--) cout << 1;
    cout << endl;
  }
}
