a=int(raw_input())
for i in range(0,a):
b=int(raw_input())
if (b-1)%4==0:
str1="192"
elif (b-1)%4==1:
str1="442"
elif (b-1)%4==2:
str1="692"
else :
str1="942"
if b<=4:
print str1
else:
str2=str((b-1)/4)
print str2+str1
System Design for Beginners
A masterclass that helps early engineers and product managers become great at designing scalable systems.
180+ learners
Details →System Design Masterclass
A masterclass that helps you become great at designing scalable, fault-tolerant, and highly available systems.
1000+ learners
Details →Redis Internals
Learn internals of Redis by re-implementing some of the core features in Golang.
98+ learners
Details →