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