import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto T = readln.chomp.to!int;

    while (T--) {
        auto N = readln.chomp.to!int;
        if (N % 2) write(7), N -= 3;
        foreach (i; 0..N/2) write(1);
        writeln;
    }
}
