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