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