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