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