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