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