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