#include <bits/stdc++.h>
const int a[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    scanf("%d", &n);
    if (n % 2 == 0) {
      for (int i = 1; i <= n / 2; i++) printf("1");
      puts("");
    } else {
      printf("7");
      for (int i = 1; i <= (n - 3) / 2; i++) printf("1");
      puts("");
    }
  }
  return 0;
}
