#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    string s = "";
    if (n % 2 == 0) {
      while (n != 0) {
        s += '1';
        n -= 2;
      }
    } else {
      s += '7';
      n -= 3;
      while (n != 0) {
        s += '1';
        n -= 2;
      }
    }
    cout << s << endl;
  }
  return 0;
}
