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