#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long int t, n, res = 0, temp, temp1;
  cin >> t;
  while (t--) {
    res = 0;
    cin >> n;
    if (n & 1) {
      temp = int(n / 2);
      cout << 7;
      for (int i = 0; i < temp - 1; i++) {
        cout << 1;
      }
    } else {
      temp = int(n / 2);
      for (int i = 0; i < temp; i++) {
        cout << 1;
      }
    }
    cout << endl;
  }
}
