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