#include <bits/stdc++.h>
using namespace std;
int execute() {
  int n;
  cin >> n;
  string s;
  s.assign(n / 2 - 1, '1');
  if (n % 2) {
    cout << 7;
  } else {
    cout << 1;
  }
  cout << s << endl;
  return 0;
}
int TE = true;
bool mTest = true;
int main() {
  ios_base::sync_with_stdio(false);
  if (mTest) cin >> TE;
  while (TE--) {
    execute();
  }
  return 0;
}
