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