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