Captain Flint and his crew keep heading to a savage shore of Byteland for several months already, drinking rum and telling stories. In such moments uncle Bogdan often remembers his nephew Denis. Today, he has told a story about how Denis helped him to come up with an interesting problem and asked the crew to solve it.

In the beginning, uncle Bogdan wrote on a board a positive integer $x$ consisting of $n$ digits. After that, he wiped out $x$ and wrote integer $k$ instead, which was the concatenation of binary representations of digits $x$ consists of (without leading zeroes). For example, let $x = 729$, then $k = 111101001$ (since $7 = 111$, $2 = 10$, $9 = 1001$).

After some time, uncle Bogdan understood that he doesn't know what to do with $k$ and asked Denis to help. Denis decided to wipe last $n$ digits of $k$ and named the new number as $r$.

As a result, Denis proposed to find such integer $x$ of length $n$ that $r$ (as number) is maximum possible. If there are multiple valid $x$ then Denis is interested in the minimum one.

All crew members, including captain Flint himself, easily solved the task. All, except cabin boy Kostya, who was too drunk to think straight. But what about you?

Note: in this task, we compare integers ($x$ or $k$) as numbers (despite what representations they are written in), so $729 < 1999$ or $111 < 1000$.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 1000$) — the number of test cases.

Next $t$ lines contain test cases — one per test case. The one and only line of each test case contains the single integer $n$ ($1 \le n \le 10^5$) — the length of the integer $x$ you need to find.

It's guaranteed that the sum of $n$ from all test cases doesn't exceed $2 \cdot 10^5$.


-----Output-----

For each test case, print the minimum integer $x$ of length $n$ such that obtained by Denis number $r$ is maximum possible.


-----Example-----
Input
2
1
3

Output
8
998



-----Note-----

In the second test case (with $n = 3$), if uncle Bogdan had $x = 998$ then $k = 100110011000$. Denis (by wiping last $n = 3$ digits) will obtain $r = 100110011$.

It can be proved that the $100110011$ is the maximum possible $r$ Denis can obtain and $998$ is the minimum $x$ to obtain it.

Difficulty: interview

Starter code:

Solutions:
# for _ in range(1):
for _ in range(int(input())):
    # a, b = map(int, input().split())
    n = int(input())
    # arr = list(map(int, input().split()))
    # s = input()
    x = (n + 3) // 4
    y = n - x
    print(y * '9' + x * '8')

for _ in range(int(input())):
    n = int(input())
    eights = ((n-1)//4)+1
    nines = n - eights
    
    print('9'*nines+'8'*eights)


for test in range(int(input())):
    n = int(input())
    c = (n + 3) // 4
    print('9' * (n - c) + '8' * c)


t = int(input())
for i in range(t):
    n = int(input())
    e = (n + 3) // 4
    print("9"*(n-e) + "8"*e)

import sys
input = sys.stdin.readline
for f in range(int(input())):
    n=int(input())
    delet=(n+3)//4
    rem=n-delet
    for i in range(rem):
        print(9,end="")
    for i in range(delet):
        print(8,end="")
    print()

for t in range(int(input())):
    n = int(input())
    eights = (n+3)//4
    nines = n-eights
    print("9"*nines+"8"*eights)


for q in range(int(input())):
    n = int(input())
    k = (n + 3) // 4
    print('9' * (n - k) + '8' * k)

for _ in range(int(input())):
    n = int(input())
    x = (n + 3) // 4
    y = n - x
    print('9' * y + '8' * x)

for _ in range(int(input())):
    n=int(input())
    q=n//4
    r=n%4
    a=-1
    if r==0:
        a=q
    else:
        a=q+1
    print("9"*(n-a)+"8"*a)

for _ in range(int(input())):
    n=int(input())
    count=0
    ans=["" for i in range(n)]
    for i in range(n):
        if count>=3*n:
            ans[i]="8"
        elif 3*n-count>=4:
            ans[i]="9"
            count+=4
        else:
            ans[i]="8"
            count+=4
    print("".join(ans))


import math
t = int(input())
while t:
    t -= 1
    n = int(input())
    temp = math.ceil(n/4)
    s = '9'*(n-temp) + '8'*temp
    print(s)

for t in range(int(input())):
    n=int(input())
    ans='9'*n
    k=(n+3)//4
    print(ans[:-k]+k*'8')

ans = []
for _ in range(int(input())):
    n = int(input())
    ansi = '9' * (3 * n // 4) + '8' * ((n - 1) // 4 + 1)
    ans.append(ansi)
print('\n'.join(ans))


import sys
#q=2
q=int(input())
for i in range(q):
    #n,k,z=[int(j) for j in sys.stdin.readline().split()]
    n=int(sys.stdin.readline())
    #a=[int(j) for j in sys.stdin.readline().split()]
    #a=sys.stdin.readline().strip()
    tak=(n*4-n)//4
    print('9'*(tak)+'8'*(n-tak))

n=int(input())
for i in range(n):
    t=int(input())
    r=(3*t)//4
    string = ""
    for j in range(r):
        string+="9"
    for j in range(t-r):
        string+="8"
    string+="\n"
    print(string,end="")

t=int(input())
while t>0:
    t-=1
    n=int(input())
    e=(n-1)//4+1
    s='9'*(n-e)+'8'*e
    print(s)

for _ in range(int(input())):
    n = int(input())
    o = (n - 1) // 4 + 1
    print((n - o) * '9' + o * '8')

import math 
T=int(input()) 
for t in range(T):
    n=int(input()) 
    rem=math.ceil(n/4) 
    ans=''
    for i in range(n-rem):
        ans+='9' 
    for i in range(rem):
        ans+='8' 
    print(ans) 


# -*- coding: utf-8 -*-
"""
@author: Saurav Sihag
"""

rr = lambda: input().strip()
rri = lambda: int(rr())
# rri = lambda: int(stdin.readline())
rrm = lambda: [int(x) for x in rr().split()]
# stdout.write(str()+'\n')

from sys import stdin, stdout, setrecursionlimit

def sol():
    n=rri()
    res=""
    if n==1:
        print("8")
        return
    if n==2:
        print("98")
        return
    
    z=(n+4-1)//4
    res='9'*(n-z)+'8'*z
    print(res)
    return
    
# sol()
def main():
    T = rri()
    for t in range(1, T + 1):
        ans=sol()
        # print("Case #{}: {}".format(t, ans))

main()