#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int main() {
  int t;
  scanf("%d", &t);
  ;
  while (t--) {
    int n;
    scanf("%d", &n);
    ;
    if (n % 2 == 0) {
      n = n / 2;
      while (n--) {
        cout << 1;
      }
      cout << "\n";
    } else {
      n = n / 2;
      n--;
      cout << 7;
      while (n--) {
        cout << 1;
      }
      cout << "\n";
    }
  }
}
