#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int maxn = 1e6 + 10;
const int mod = 1e9 + 7;
const int INF = 1e9 + 10;
const int N = 1e6;
int t;
int main(){
cin >> t;
while(t--){
int x;
cin >> x;
if(x == 2){
cout << "1" << endl;
continue;
}
if(x % 2 == 0){
string s = "";
x = x/2;
x = x - 1;
while(x--){
s += '1';
}
cout << s << endl;
}
else{
string s ="";
s += '7';
x = x/2;
while(x--){
s += '1';
}
cout << s << endl;
}
}
system("pause");
return 0;
}