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