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