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