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