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