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