#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (a == 1) {
      cout << 0;
      continue;
    }
    if (a % 2 != 0) cout << 7, a -= 3;
    for (int i = 0; i < a; i += 2) {
      cout << 1;
    }
    printf("\n");
  }
}
