#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    if (n % 2 != 0) {
      n -= 3;
      if (n == 0)
        cout << 7 << endl;
      else
        cout << 7;
    }
    while (n) {
      n -= 2;
      if (n == 0)
        cout << 1 << endl;
      else
        cout << 1;
    }
  }
}
