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