You have been blessed as a child of Omkar. To express your gratitude, please solve this problem for Omkar!

An array a of length n is called complete if all elements are positive and don't exceed 1000, and for all indices x,y,z (1 ≤ x,y,z ≤ n), a_{x}+a_{y} ≠ a_{z} (not necessarily distinct).

You are given one integer n. Please find any complete array of length n. It is guaranteed that under given constraints such array exists.

Input

Each test contains multiple test cases. The first line contains t (1 ≤ t ≤ 1000) — the number of test cases. Description of the test cases follows.

The only line of each test case contains one integer n (1 ≤ n ≤ 1000).

It is guaranteed that the sum of n over all test cases does not exceed 1000.

Output

For each test case, print a complete array on a single line. All elements have to be integers between 1 and 1000 and for all indices x,y,z (1 ≤ x,y,z ≤ n) (not necessarily distinct), a_{x}+a_{y} ≠ a_{z} must hold.

If multiple solutions exist, you may print any.

Example

Input


2
5
4


Output


1 5 3 77 12
384 384 44 44

Note

It can be shown that the outputs above are valid for each test case. For example, 44+44 ≠ 384.

Below are some examples of arrays that are NOT complete for the 1st test case:

[1,2,3,4,5] 

Notice that a_{1}+a_{2} = a_{3}.

[1,3000,1,300,1] 

Notice that a_{2} = 3000 > 1000.

Difficulty: EASY
Tags: Implementation

Constructive algorithms

Starter code:

Solutions:
t = int(input())
for i in range(0, t):
	n = int(input())
	L = [1] * n
	print(*L)


t = int(input())
for i in range(t):
	n = int(input())
	l = [1] * n
	print(*l)


for t in range(int(input())):
	print(*[1] * int(input()))


for _ in range(int(input())):
	n = int(input())
	print(n * '1 ')


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
T = inp()
tests = []
for _ in range(T):
	tests.append(inp())
for n in tests:
	for i in range(n):
		print(1, end=' ')
	print()


t = int(input())
for _ in range(0, t):
	n = int(input())
	k = 1
	count = 0
	for i in range(0, n):
		print(k, end=' ')
		count += 1
		if count % 2 == 0:
			k += 2
	print()


for lo in range(int(input())):
	n = int(input())
	ls = [1] * n
	print(*ls)


tc = int(input())
for x in range(tc):
	n = int(input())
	print('1 ' * n)


def random(n):
	arr = [n] * n
	for i in arr:
		print(i, end=' ')
	print()
t = int(input())
for _ in range(t):
	n = int(input())
	random(n)


t = int(input())
for _ in ' ' * t:
	n = int(input())
	print(*[3] * n)


t = int(input())
Maxn = 210000
while t > 0:
	t -= 1
	n = int(input())
	for i in range(0, n):
		print('1', end=' ')
	print('')


k = int(input())
for i in range(k):
	n = int(input())
	print('2 ' * n)


t = int(input())
while t:
	n = int(input())
	l = []
	for i in range(0, n, 2):
		l.append(i + 1)
	for i in range(1, n, 2):
		l.append(i)
	for i in range(len(l)):
		print(l[i], end=' ')
	print()
	t -= 1


qt = int(input())
for ki in range(qt):
	n = int(input())
	for i in range(n):
		print('1 ', end='')
	print()


for _ in range(int(input())):
	n = int(input())
	x = ['1']
	if n == 1:
		print(1)
	else:
		x = '1 ' * n
		print(x[:-1])


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	ans = ['1' for i in range(n)]
	print(' '.join(ans))


testcases = int(input())
for testcase in range(testcases):
	n = int(input())
	arr = ['1'] * n
	print(' '.join(arr))


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	T = int(input())
	for _ in [0] * T:
		N = int(input())
		print(*[1] * N)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	for _ in range(n):
		print(1000, end=' ')
	print('')


t = int(input())
a = [1 for x in range(1000)]
for _ in range(t):
	n = int(input())
	print(*a[:n])


import random
for i in range(int(input())):
	print(' '.join([random.choice(['36', '256']) for i in range(int(input()))]))


t = int(input())
while t:
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()
	t = t - 1


q = int(input())
for qu in range(q):
	n = int(input())
	res = [1000 for i in range(n)]
	print(*res)


for i in range(int(input())):
	n = int(input())
	l = ''
	for r in range(n):
		l += '2 '
	print(l)


t = input()
for opo in range(int(t)):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	ans = [1] * n
	for i in ans:
		print(i, end=' ')
	print()


import math

def mi():
	return map(int, input().split())

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def si():
	return input().split()
t = ii()
for _ in range(t):
	n = ii()
	for i in range(n):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	print('10 ' * n)


for s in [*open(0)][1:]:
	print('1 ' * int(s))


t = int(input())
for _t in range(t):
	n = int(input())
	for i in range(n):
		print('1', end=' ')
	print()


count = int(input())
arr = []
for i in range(count):
	arr.append(int(input()))
for item in arr:
	newArr = [1] * item
	print(*newArr)


for ii in range(int(input())):
	n = int(input())
	print('1 ' * n)


a = int(input())
for i in range(a):
	t = int(input())
	for j in range(t):
		print(1, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [2 for _ in range(n)]
	print(*arr, sep=' ')


for _ in range(int(input())):
	n = int(input())
	ct = 0
	while ct < n:
		print(2, end=' ')
		ct += 1
	print()


t = int(input())
for i in range(t):
	n = int(input())
	print(str(1) + (n - 1) * ' 1')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [10] * n
	for i in range(n):
		print(a[i], end=' ')
	print()


from sys import stdin

def ip():
	return [int(i) for i in stdin.readline().split()]

def sp():
	return [str(i) for i in stdin.readline().split()]

def solve():
	n = int(input())
	for i in range(n):
		print(1, '', end='')
	print()
t = int(input())
for i in range(t):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	li = [2] * n
	print(*li)


x = [i for i in range(500, 1001)]
for _ in range(int(input())):
	ans = [1000 for _ in range(int(input()))]
	print(' '.join(map(str, ans)))


for _ in range(int(input())):
	n = int(input())
	a = [1 for i in range(n)]
	for i in range(n):
		print(a[i], end=' ')
	print()


for i in [*open(0)][1:]:
	for j in range(int(i)):
		print(1, end=' ')
	print()


import math
for _ in range(int(input())):
	n = int(input())
	d = [1] * n
	print(*d)


n = int(input())
while n:
	n -= 1
	print(' '.join('1' * int(input())))


t = int(input())
for t in range(t):
	p = int(input())
	for i in range(p):
		if i % 2 == 0:
			print(7, end=' ')
		else:
			print(5, end=' ')
	print()


t = int(input())
while t != 0:
	n = int(input())
	p = [1] * n
	print(*p)
	t -= 1


import sys
import math
from functools import reduce
import bisect

def getN():
	return int(input())

def getNM():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def input():
	return sys.stdin.readline().rstrip()

def index(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	return False
for _ in range(int(input())):
	n = getN()
	print(*[1] * n)


for i in range(int(input())):
	n = int(input())
	for k in range(n):
		if k != n - 1:
			print(1, end=' ')
		else:
			print(1)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		result = [1] * n
		print(' '.join((str(x) for x in result)))
main()


t = int(input())
for _ in range(t):
	n = int(input())
	for x in range(n):
		print(1, end=' ')
	print()


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	n = int(input())
	print(*[1] * n)


t = int(input())
for _ in range(t):
	n = int(input())
	l = [1] * n
	print(*l)


n = int(input())
for i in range(n):
	num = int(input())
	print('1 ' * num)


t = int(input())
for a in range(t):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	ans = [1] * n
	print(*ans)


import random

def read():
	t = int(input())
	for i in range(t):
		n = int(input())
		v = str(random.randrange(1, 1000))
		ans = ' '.join([v for i in range(n)])
		print(ans)
read()


t = int(input())
while t:
	l = []
	n = int(input())
	b = n % 2
	n = n // 2
	a = 1
	while n:
		l.append(str(a))
		l.append(str(a))
		a += 2
		n -= 1
	if b:
		l.append(str(a))
	print(' '.join(l))
	t -= 1


import array as arr
t = int(input())
for _ in range(t):
	n = int(input())
	print('3 ' * n)


t = int(input())
for i in range(t):
	n = int(input())
	a = [999 for j in range(n)]
	print(' '.join(map(str, a)))


T = int(input().strip())
while T:
	T -= 1
	N = int(input().strip())
	for i in range(0, N):
		print('1', end=' ')
	print('')


for _ in range(int(input())):
	n = int(input())
	lis = [1000] * n
	print(*lis)


t = int(input())
for _ in range(t):
	n = int(input())
	li = []
	for i in range(n):
		li.append('7')
	print(*li)


for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print('2', end=' ')
	print()


import math
for w in range(int(input())):
	n = int(input())
	a = [1 for i in range(n)]
	print(*a)


for _ in range(int(input())):
	len_arr = int(input())
	print(' '.join(['1' for x in range(len_arr)]))


test = int(input())

def solve():
	n = int(input())
	for i in range(n):
		print('1', end=' ')
	print()
while test:
	solve()
	test -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	print(' '.join(map(str, [2] * n)))


def main():
	for _ in range(int(input())):
		n = int(input())
		print('2' + ' 2' * (n - 1))
main()


for _ in range(int(input())):
	li = [1] * int(input())
	print(*li)


for t in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	print(' '.join(map(str, [1] * int(input()))))


t = int(input())
for i in range(t):
	n = int(input())
	s = ''
	for j in range(n):
		s += '1 '
	print(s)


def printArray():
	test = int(input())
	while test > 0:
		n = int(input())
		res = []
		base = -1
		for i in range(n):
			if i ^ 1 == i + 1:
				base += 2
			res.append(base)
		print(*res)
		test -= 1
printArray()


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	print(' '.join(['1'] * n))


production = True
import sys, math, collections

def input(input_format=0, multi=0):
	if multi > 0:
		return [input(input_format) for i in range(multi)]
	else:
		next_line = sys.stdin.readline()[:-1]
		if input_format >= 10:
			use_list = False
			input_format = int(str(input_format)[-1])
		else:
			use_list = True
		if input_format == 0:
			formatted_input = [next_line]
		elif input_format == 1:
			formatted_input = list(map(int, next_line.split()))
		elif input_format == 2:
			formatted_input = list(map(float, next_line.split()))
		elif input_format == 3:
			formatted_input = list(next_line)
		elif input_format == 4:
			formatted_input = list(map(int, list(next_line)))
		elif input_format == 5:
			formatted_input = next_line.split()
		else:
			formatted_input = [next_line]
		return formatted_input if use_list else formatted_input[0]

def out(output_line, output_format=0, newline=True):
	formatted_output = ''
	if output_format == 0:
		formatted_output = str(output_line)
	elif output_format == 1:
		formatted_output = ' '.join(map(str, output_line))
	elif output_format == 2:
		formatted_output = '\n'.join(map(str, output_line))
	print(formatted_output, end='\n' if newline else '')

def log(*args):
	if not production:
		print('$$$', end='')
		print(*args)
enu = enumerate
ter = lambda a, b, c: b if a else c

def mapl(iterable, format=0):
	if format == 0:
		return list(map(int, iterable))
	elif format == 1:
		return list(map(str, iterable))
	elif format == 2:
		return list(map(list, iterable))

def solve():
	n = input(11)
	out([1] * n, 1)
	return
for i in range(input(11)):
	solve()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for i in range(n):
		a.append(str(1))
	print(' '.join(a))


t = int(input())
for i in range(t):
	n = int(input())
	print(' '.join([str(n)] * n))


import bisect
import sys
import math
input = sys.stdin.readline
import functools
from collections import defaultdict

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def solve(case):
	n = inp()
	res = []
	i = 1000
	while len(res) < n:
		res.append(i)
		if len(res) < n:
			res.append(i)
		i -= 1
	return ' '.join((str(v) for v in res))
if len(sys.argv) > 1 and sys.argv[1].startswith('input'):
	f = open('./' + sys.argv[1], 'r')
	input = f.readline
T = inp()
for i in range(T):
	res = solve(i + 1)
	print(str(res))


import random
t = int(input())
for __ in range(t):
	n = int(input())
	number = random.randint(1, 1000)
	for i in range(n):
		print(number, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	array = [5] * n
	print(*array)


import sys
import heapq, functools, collections
import math, random
from collections import Counter, defaultdict

def solve(k):
	console('----- solving ------')
	lst = [1, 3]
	for _ in range(15):
		lst.append(lst[-1] + lst[-2] + 1)
	res = []
	for x in lst:
		res.append(x)
		res.append(x)
	return ' '.join((str(x) for x in res[:k]))

def console(*args):
	print('\x1b[36m', *args, '\x1b[0m', file=sys.stderr)
	return
for case_num in range(int(input())):
	k = int(input())
	print(' '.join(['1' for _ in range(k)]))


def solve(k):
	arr = ['1'] * k
	ans = ' '.join(arr)
	return ans
t = int(input())
for _ in range(t):
	i = int(input())
	print(solve(i))


t = int(input())
for i in range(t):
	n = int(input())
	lis = []
	for k in range(n):
		lis.append(44)
	print(*lis)


for i in range(int(input())):
	for j in range(int(input())):
		print(1, end=' ')
	print('')


a = int(input())
for i in range(a):
	n = int(input())
	for j in range(1, n + 1):
		print(1, end=' ')
	print('')


def hjhj(n):
	num = 1000 // n
	output = ''
	for i in range(n):
		output += str(num) + ' '
	print(output)
t = int(input())
l = []
for i in range(t):
	l.append(int(input()))
for n in l:
	hjhj(n)


for ii in range(int(input())):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


import math
t = eval(input())
while t != 0:
	n = eval(input())
	i = 0
	while i != n:
		if i == n - 1:
			if i % 2 == 0:
				print(1)
			else:
				print(1000)
			break
		if i % 2 == 0:
			print(1, end=' ')
		else:
			print(1000, end=' ')
		i = i + 1
	t = t - 1


def complete(n):
	a = []
	for i in range(n):
		a.append(2)
	print(*a)
t = int(input())
for _ in range(t):
	n = int(input())
	complete(n)


t = int(input())
while t:
	n = int(input())
	l1 = []
	for i in range(0, n):
		l1.append(2)
	print(*l1)
	t = t - 1


import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
input = sys.stdin.readline
mo = 10 ** 9 + 7

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def pref(a, n, f):
	pre = [0] * n
	if f == 0:
		pre[0] = a[0]
		for i in range(1, n):
			pre[i] = a[i] + pre[i - 1]
	else:
		pre[-1] = a[-1]
		for i in range(n - 2, -1, -1):
			pre[i] = pre[i + 1] + a[i]
	return pre
maxint = 10 ** 24

def kadane(a, size):
	max_so_far = -maxint - 1
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far
for _ in range(inin()):
	n = inin()
	l = [1] * n
	print(*l)


for i in range(int(input())):
	n = int(input())
	print(1, end=' ')
	for i in range(n - 1):
		print(1000, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	k = []
	for j in range(n):
		k.append('1')
	print(*k)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = []
	for i in range(n):
		ans.append(1)
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	res = ' '.join(['1'] * n)
	print(res)


for _ in range(int(input())):
	n = int(input())
	for j in range(n):
		print(1, end=' ')
	print()


no = int(input())
for r in range(no):
	k = int(input())
	print('2 ' * k)


for i in range(int(input())):
	n = int(input())
	l = []
	for i in range(1, n + 1):
		if i % 2 != 0:
			l.append(i)
		elif i == 1000:
			l.append(999)
		else:
			l.append(i + 1)
	print(*l)


answer = []
for i in range(int(input())):
	c = 0
	x = []
	n = int(input())
	if n % 2 == 0:
		for j in range(n // 2):
			x.append(6)
			x.append(2)
	else:
		for j in range(n // 2):
			x.append(6)
			x.append(2)
		x.append(6)
	answer.append(x)
for i in range(len(answer)):
	for j in answer[i]:
		print(j, end=' ')
	print()


for nt in range(int(input())):
	n = int(input())
	print(*[1] * n)


import sys
input = sys.stdin.readline
from collections import *
t = int(input())
for _ in range(t):
	n = int(input())
	print(*[1] * n)


def func(num):
	for i in range(num):
		y = [1 for x in range(int(input()))]
		print(*y)
num = int(input())
func(num)


def prob_1(n):
	z = []
	for i in range(n):
		z.append(5)
	return z
t = int(input())
for i in range(t):
	n = int(input())
	x = prob_1(n)
	for i in x:
		print(i, ' ', end='')
	print()


t = int(input())
while t > 0:
	n = int(input())
	arr = [1 for _ in range(n)]
	for i in range(n):
		if i == n - 1:
			print(arr[i], end='')
		else:
			print(arr[i], end=' ')
	print()
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	l = [2] * n
	s = ' '.join(map(str, l))
	print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


from collections import Counter
tests = int(input())
for _ in range(tests):
	(n,) = map(int, input().strip().split())
	arr = [1] * n
	[print(a, end=' ') for a in arr]
	print()


t = int(input())
for i in range(t):
	a = int(input())
	arr = [1] * a
	print(*arr)


t = int(input())
while t > 0:
	n = int(input())
	k = 1
	a = []
	c = flag = 0
	while c < n:
		a.append(k)
		if flag == 0:
			k = k + 2
		if k > 1000:
			flag = 1
			k = 1
		c = c + 1
	for i in range(len(a)):
		print(a[i], end=' ')
	print()
	t = t - 1


for _ in range(int(input().strip())):
	n = int(input().strip())
	for i in range(n):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	arr = [1 for i in range(n)]
	print(*arr)


def sol():
	am = int(input())
	if am == 1:
		print(1)
	elif am == 2:
		print(1, 3)
	else:
		arr = [1, 1]
		for i in range(2, am, 2):
			arr.append(i + 1)
			arr.append(i + 1)
		if len(arr) > am:
			arr.pop(len(arr) - 1)
		print(*arr)
for _ in range(int(input())):
	sol()


n = int(input())
for i in range(n):
	n1 = int(input())
	s = n1 * '1 '
	print(s)


tc = int(input())
for ctr in range(tc):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


T = int(input())
for _ in range(T):
	print(*[1] * int(input()))


a = int(input())
for i in range(a):
	print('1 ' * int(input()))


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	l = [2] * n
	for i in l:
		print(i, end=' ')
	print()


a = int(input())
for i in range(a):
	b = int(input())
	d = []
	for i in range(b):
		d.append(1)
	print(*d)


t = int(input())
while t > 0:
	n = int(input())
	while n > 0:
		print(1, end=' ')
		n -= 1
	print()
	t -= 1


n = int(input())
while n > 0:
	t = int(input())
	print('999 ' * t)
	n -= 1


import sys
import math

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
t = II()
for q in range(t):
	n = II()
	a = []
	for i in range(n):
		a.append(1)
	print(*a)


agGK = int(input())
for _ in range(agGK):
	n = int(input())
	x = -1
	for i in range(n):
		j = i + 1
		if j % 2 == 1:
			print(x + 2, end=' ')
			x += 2
		else:
			print(x, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	i = 1
	c = 0
	while i <= n:
		if i <= 500:
			print(2 * i - 1, end=' ')
		elif i > 500:
			i = 1
			continue
		i += 1
		c += 1
		if c == n:
			break
	print()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	nList = [1 for i in range(n)]
	print(*nList)


import random
t = int(input())
for i in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(996)
	print(*arr, sep=' ')


t = int(input())
n = list()
a = list()
for x in range(t):
	n.append(int(input()))
	print('1 ' * n[x])


for testcases in range(int(input())):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


x = int(input())
for _ in range(x):
	n = int(input())
	print(' '.join(['1'] * n))


def solve():
	n = int(input())
	l = [1] * 1000
	ll = l[:n]
	for i in ll:
		print(i, end=' ')
	print()
	return
t = 1
t = int(input())
while t > 0:
	t -= 1
	solve()


t = int(input())
for i in range(t):
	a = int(input())
	s = []
	for j in range(a):
		s.append(1)
	print(*s)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = [2 for i in range(n)]
	print(*ans)


import random
for i in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(1)
	print(*arr, sep=' ')


from collections import Counter
import sys
for _ in range(int(input())):
	n = int(input())
	arr = [1] * n
	print(*arr)


from sys import stdin, stdout
import math
input = stdin.readline

def print(x='', y='', end='\n'):
	if y == '':
		stdout.write(str(x) + end)
	else:
		stdout.write(str(x) + ' ' + str(y) + end)

def solve():
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()
tt = 1
tt = int(input())
for __ in range(tt):
	solve()


for t in range(int(input())):
	n = int(input())
	a = [n for i in range(n)]
	print(*a)


q = int(input())
while q != 0:
	q -= 1
	n = int(input())
	for i in range(0, n):
		print('1 ', end='')
	print('')


for _ in range(int(input())):
	n = int(input())
	for i in range(0, n):
		print(1, end=' ')
	print()


t = int(input())
lst = []
for i in range(t):
	n = int(input())
	lst.append(n)
for i in range(t):
	a = '6 ' * lst[i]
	print(a)


import random
for i in range(int(input())):
	n = int(input())
	a = random.randint(1, 10)
	count = 0
	nums = []
	while count <= n - 1:
		nums.append(a)
		count = count + 1
	print(' '.join(map(str, nums)))


t = int(input())
for i in range(t):
	n = int(input())
	for j in range(n):
		print('1 ', end='')
	print('')


test = int(input())
for i in range(test):
	ls = []
	n = int(input())
	for k in range(n):
		ls.append(n)
	print(*ls)


from collections import Counter
import math
import sys
from bisect import bisect, bisect_left, bisect_right

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def mod():
	return 10 ** 9 + 7
for i in range(INT()):
	n = INT()
	ans = [2] * n
	print(*ans)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(n,) = I()
	print(*[1] * n)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [1] * n
	print(*a)


t = int(input())
for i in range(t):
	n = int(input())
	array = '1'
	for x in range(n - 1):
		array += ' 1'
	print(array)


for i in range(int(input())):
	n = int(input())
	x = []
	for i in range(n):
		x.append(n)
	print(*x)


t = int(input())
for _ in range(t):
	n = int(input())
	c = []
	l = 1
	if n % 2 == 0:
		for i in range(n // 2):
			c.append(l)
			l = l + 2
	else:
		for i in range(n // 2 + 1):
			c.append(l)
			l = l + 2
	if n % 2 == 0:
		for i in c:
			print(i, end=' ')
		for i in range(len(c)):
			print(c[i], end=' ')
	else:
		for i in c:
			print(i, end=' ')
		for i in range(len(c) - 1):
			print(c[i], end=' ')
	print()


def R():
	return map(int, input().split())

def L():
	return list(map(int, input().split()))

def I():
	return int(input())
for _ in range(I()):
	n = I()
	print('1 ' * n)


import math
t = int(input())
for g in range(t):
	n = int(input())
	A = [1] * n
	print(*A)


t = int(input())
for _ in range(t):
	n = int(input())
	s = '100 ' * n
	print(s)


test = int(input())
for t in range(test):
	n = int(input())
	for x in range(n):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	l = []
	x = 1
	while len(l) != n:
		l.append(x)
		if len(l) != n:
			l.append(x)
		x += 2
	for i in l:
		print(i, end=' ')
	print()


t = int(input())
for _ in range(t):
	print(' '.join(['1'] * int(input())))


for _ in range(int(input())):
	n = int(input())
	l = [n for i in range(n)]
	print(*l)


for i in range(int(input())):
	n = int(input())
	arr = [1000] * n
	print(*arr)


for tc in range(int(input())):
	for i in range(int(input())):
		print(1, end=' ')
	print()


t = int(input())
for i in range(t):
	a = int(input())
	if a == 5:
		print(str(1) + ' ' + str(5) + ' ' + str(3) + ' ' + str(77) + ' ' + str(12))
	elif a == 4:
		print(str(384) + ' ' + str(384) + ' ' + str(44) + ' ' + str(44))
	else:
		for t in range(a):
			print(1, end=' ')
		print()


for t in range(int(input())):
	n = int(input())
	x = 1
	i = 0
	while i < n:
		if x > 1000:
			x = 1
		print(x, end=' ')
		i += 1
		x += 2
	print()


testcases = int(input())
j = 0
while j < testcases:
	length = int(input())
	i = 0
	while i < length:
		print('1', end=' ')
		i += 1
	j += 1
	print(' ')


t = int(input())
for i in range(t):
	n = int(input())
	arr = [n] * n
	print(' '.join((str(x) for x in arr)))


n = int(input())
for i in range(n):
	g = ''
	f = int(input())
	for j in range(f - 1):
		g = g + ' 1'
	g = g + ' 1000'
	print(g)


import sys
import math
import collections
import heapq

def set_debug(debug_mode=False):
	if debug_mode:
		fin = open('input.txt', 'r')
		sys.stdin = fin

def int_input():
	return list(map(int, input().split()))
t = int(input())
for ti in range(1, t + 1):
	n = int(input())
	A = [1] * n
	print(*A)


import sys
import os
readline = sys.stdin.readline
t = int(input())
while t:
	n = int(input())
	t -= 1
	for j in range(n):
		print(1, end=' ')
	print()


t = int(input())
for l in range(t):
	n = int(input())
	ans = [1 for i in range(n)]
	for i in ans:
		print(i, end=' ')
	print()


z = input
mod = 10 ** 9 + 7
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)
for i in range(int(z())):
	x = int(z())
	l = []
	j = 1
	s = 2
	d = 100
	for i in range(1000, 1000 - x, -1):
		l.append(2)
	print(*l)


def process():
	mylist = [1, 3]
	n = int(input())
	if n >= 500:
		dt = list(range(1, 1000, 2))
		dt += dt[:n - 500]
		print(*dt)
	else:
		print(*list(range(1, 2 * n, 2)))
for i in range(int(input())):
	process()


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def solve():
	n = I()
	a = []
	for i in range(n):
		a.append(1)
	print(*a)
for _ in range(I()):
	solve()


for _ in range(int(input())):
	i = int(input())
	for x in range(i):
		print(50, end=' ')
	print()


n = int(input())
for _ in range(n):
	i = int(input())
	print(' '.join(['3'] * i))


def main():
	n = int(input())
	for i in range(n):
		s = int(input())
		for j in range(s):
			print(2, end=' ')
		print()
main()


t = int(input())
result = []
for i in range(t):
	n = int(input())
	result.append(' '.join([str(1) for e in range(n)]))
for m in result:
	print(m)


for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(0, n, 2):
		a.append(i + 1)
		a.append(i + 1)
	if n % 2 == 1:
		a.pop()
	print(*a)


for _ in range(int(input())):
	print(' '.join((str(i) for i in [1] * int(input()))))


t = int(input())
d = []
for i in range(0, t):
	d.append(int(input()))
for i in range(0, t):
	out = []
	for j in range(0, d[i]):
		out.append(2)
	for x in range(len(out)):
		print(out[x], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	print((str(n) + ' ') * n)


queries = int(input())
for i in range(queries):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = []
	ans = 1
	count = 2
	for i in range(n):
		a.append(1)
	print(*a)


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
for _ in range(II()):
	ans = [1] * II()
	print(*ans)


try:
	t = int(input())
	while t:
		n = int(input())
		a = [1] * n
		print(*a)
except:
	pass


def func(n):
	return ' '.join(['1' for i in range(n)])

def main():
	t = int(input())
	input_list = [int(input()) for i in range(t)]
	for i in list(map(func, input_list)):
		print(i)
main()


test = int(input())
for _ in range(test):
	n = int(input())
	for _ in range(n):
		print(1, end=' ')
	print()


I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n,) = I()
	ar = [1] * n
	print(*ar)


import sys
input = sys.stdin.buffer.readline

def iinp() -> int:
	return int(input())

def linp() -> list:
	return [int(z) for z in input().split()]

def sinp():
	return input().decode('unicode-escape')[0:-2]
for _ in range(iinp()):
	n = iinp()
	a = [1] * n
	for i in a:
		print(i, end=' ')
	print()


def solve(n):
	l = []
	for i in range(n):
		l.append(1)
	print(*l)
t = int(input())
for _ in range(t):
	n = int(input())
	solve(n)


for i in range(int(input())):
	print('1000 ' * int(input()))


import math as mt
import sys, string
input = sys.stdin.readline
from collections import defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
t = I()
for _ in range(t):
	n = I()
	print('1 ' * n)


for _ in range(int(input())):
	n = int(input())
	li = []
	for i in range(n):
		print('1 ', end='')
	print('')


x = int(input())
for i in range(x):
	y = int(input())
	z = '1 ' * y
	z1 = z[:-1]
	print(z1)


import sys, io, os, time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline
for ii in range(int(input())):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	n = mint()
	print(*[1] * n)
for i in range(mint()):
	solve()


T = int(input())
for t in range(T):
	n = int(input())
	if n == 1:
		print(1)
	else:
		x = [1] * (n - 1) + [3]
		print(*x)


from sys import stdin, stdout
test = int(stdin.readline())
for _ in range(test):
	N = int(stdin.readline())
	ans = [1] * N
	print(*ans)


import sys
import os
from io import BytesIO, IOBase

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def ddi():
	return defaultdict(int)

def ddl():
	return defaultdict(list)

def ddd():
	return defaultdict(defaultdict(int))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict
from math import gcd, pi, inf
for _ in range(ii()):
	n = ii()
	res = [1] * n
	print(*res)


for _ in range(int(input())):
	n = int(input())
	l = []
	x = 3
	while len(l) != n:
		l.append(x)
	for i in l:
		print(i, end=' ')
	print()


t = int(input())
cases = []
for i in range(t):
	n = int(input())
	cases.append(n)
for case in cases:
	for i in range(case):
		print(1, end=' ')
	print()


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

def LIST():
	return list(map(int, input().split()))

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
for tt in range(INT()):
	n = INT()
	d = []
	for i in range(n):
		d.append(5)
	print(*d)


T = int(input())
for it in range(T):
	n = int(input())
	print('1 ' * n)


for _ in range(int(input())):
	n = int(input())
	print('2 ' * n)


from sys import stdout, stdin
(_input, _print) = (stdin.readline, stdout.write)
(_int, _range) = (int, range)

def solution():
	for _ in _range(_int(_input())):
		n = _int(_input())
		print(*[1] * n)
solution()


x = int(input())
for i in range(x):
	a = int(input())
	l = []
	for i in range(a):
		l.append('1')
	print(' '.join(l))


w = int(input())
for _ in range(w):
	n = int(input())
	A = [0 for i in range(n)]
	r = 1
	for i in range(0, n, 2):
		A[i] = r
		r += 2
	r = 1
	for i in range(1, n, 2):
		A[i] = r
		r += 2
	for i in A:
		print(i, end=' ')
	print()


def main():
	t = int(input())
	for __ in range(t):
		n = int(input())
		ans = [2] * n
		print(*ans)
main()


for case in range(int(input())):
	n = int(input())
	a = [1] * n
	print(*a)


for _t in range(int(input())):
	n = int(input())
	i = 1
	while n > 0:
		n -= 1
		if i >= 999:
			i = 1
		print(i, end=' ')
		i += 2
	print()


from sys import stdin
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	n = int(inp())
	ans = [1] * n
	print(*ans)


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
t = int(input())
while t:
	n = int(input())
	l = [1] * n
	print(*l)
	t -= 1


t = int(input())
ans = []
for tt in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(1)
	ans.append(arr)
for i in range(len(ans)):
	for j in range(len(ans[i])):
		print(ans[i][j], end=' ')
	print()


j = int(input())
for i in range(j):
	c = int(input())
	print('1 ' * c)


for _ in range(int(input())):
	n = int(input())
	print(' '.join([str(1)] * n))


def omkar_array(n):
	return [1] * (n - 1) + [3]
for _ in range(int(input())):
	n = int(input())
	print(' '.join(map(str, omkar_array(n))))


import sys
case = int(input())
for i in range(0, case):
	length_n = int(input())
	num_list = []
	for j in range(0, length_n):
		num_list.append(length_n)
	for i in range(0, length_n):
		print(num_list[i], end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	for j in range(n):
		print(1, end=' ')
		if j == n - 1:
			print('')


import math
from collections import deque
import sys
sys.setrecursionlimit(10 ** 4)

def Divisors(n):
	l = []
	i = 2
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):
	l = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			l.append(p)
	return l

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(n)
	return l

def Factors(n):
	result = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if i == n / i:
				result.append(i)
			else:
				result.append(i)
				result.append(n // i)
	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):
	max_so_far = 0
	max_ending_here = 0
	size = len(a)
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < abs(max_ending_here):
			max_so_far = max_ending_here
	return max_so_far

def longestsubarray(arr, n, k):
	current_count = 0
	max_count = 0
	for i in range(0, n, 1):
		if arr[i] % k != 0:
			current_count += 1
		else:
			current_count = 0
		max_count = max(current_count, max_count)
	return max_count

def main():
	n = int(input())
	l = []
	for i in range(0, n - 1):
		l.append(1)
	l.append(1000)
	print(*l)
t = int(input())
for i in range(0, t):
	main()


t = int(input())
a = [i for i in range(1, 1001, 2)]
a = a + a
while t:
	n = int(input())
	for i in range(n):
		print(a[i], end=' ')
	print()
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	out = [1] * n
	print(*out)


tc = int(input())
for i in range(tc):
	n = int(input())
	s = []
	for i in range(n):
		s.append('1 ')
	print(''.join(s))


from collections import defaultdict
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange
sys.setrecursionlimit(10 ** 2)

def print_case_iterable(case_num, iterable):
	print('Case #{}: {}'.format(case_num, ' '.join(map(str, iterable))))

def print_case_number(case_num, iterable):
	print('Case #{}: {}'.format(case_num, iterable))

def print_iterable(A):
	print(' '.join(A))

def read_int():
	return int(f.readline().strip())

def read_int_array():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def read_string():
	return list(f.readline().strip())

def ri():
	return int(f.readline().strip())

def ria():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def rs():
	return list(f.readline().strip())

def bi(x):
	return bin(x)[2:]
from collections import deque
import math
NUMBER = 10 ** 9 + 7

def factorial(n):
	M = NUMBER
	f = 1
	for i in range(1, n + 1):
		f = f * i % M
	return f

def mult(a, b):
	return a * b % NUMBER

def minus(a, b):
	return (a - b) % NUMBER

def plus(a, b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, y, x) = egcd(b % a, a)
		return (g, x - b // a * y, y)

def modinv(a):
	m = NUMBER
	(g, x, y) = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m

def choose(n, k):
	if n < k:
		assert false
	return mult(factorial(n), modinv(mult(factorial(k), factorial(n - k)))) % NUMBER
from collections import deque, defaultdict
import heapq
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc

def dfs(g, timeIn, timeOut, depths, parents):
	cnt = 0
	stack = [[1, 0, 0, 0]]
	while stack:
		(v, neig_i, parent, depth) = stack[-1]
		parents[v] = parent
		depths[v] = depth
		if neig_i == 0:
			timeIn[v] = cnt
			cnt += 1
		while neig_i < len(g[v]):
			u = g[v][neig_i]
			if u == parent:
				neig_i += 1
				continue
			stack[-1][1] = neig_i + 1
			stack.append([u, 0, v, depth + 1])
			break
		if neig_i == len(g[v]):
			stack.pop()
			timeOut[v] = cnt
			cnt += 1
cnt = 0

@bootstrap
def dfs(v, adj, timeIn, timeOut, depths, parents, parent=0, depth=0):
	global cnt
	parents[v] = parent
	depths[v] = depth
	timeIn[v] = cnt
	cnt += 1
	for u in adj[v]:
		if u == parent:
			continue
		yield dfs(u, adj, timeIn, timeOut, depths, parents, v, depth + 1)
	timeOut[v] = cnt
	cnt += 1
	yield

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)

def get_num_2_5(n):
	twos = 0
	fives = 0
	while n > 0 and n % 2 == 0:
		n //= 2
		twos += 1
	while n > 0 and n % 5 == 0:
		n //= 5
		fives += 1
	return (twos, fives)

def shift(a, i, num):
	for _ in range(num):
		(a[i], a[i + 1], a[i + 2]) = (a[i + 2], a[i], a[i + 1])

def equal(x, y):
	return abs(x - y) <= 1e-09

def getAngle(a, b, c):
	ang = math.degrees(math.atan2(c[1] - b[1], c[0] - b[0]) - math.atan2(a[1] - b[1], a[0] - b[0]))
	return ang + 360 if ang < 0 else ang

def getLength(a, b):
	return math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
from heapq import heapify, heappush, heappop

def solution(n):
	sol = []
	cnt = 0
	if n % 2 == 0:
		while cnt < n:
			sol.extend([1000 - cnt // 2, 1000 - cnt // 2])
			cnt += 2
	else:
		while cnt < n - 1:
			sol.extend([1000 - cnt // 2, 1000 - cnt // 2])
			cnt += 2
		sol.append(1000 - cnt // 2)
	return ' '.join(map(str, sol))

def main():
	T = 1
	T = ri()
	for i in range(T):
		n = ri()
		x = solution(n)
		if 'xrange' not in dir(__builtins__):
			print(x)
		else:
			(print >> output, str(x))
	if 'xrange' in dir(__builtins__):
		print(output.getvalue())
		output.close()
if 'xrange' in dir(__builtins__):
	import cStringIO
	output = cStringIO.StringIO()
main()


t = int(input())
import math
for _ in range(t):
	n = int(input())
	print('1 ' * n)


for t in range(int(input())):
	n = int(input())
	for i in range(n):
		print(n, end=' ')
	print()


n = int(input())
for i in range(n):
	n = int(input())
	out = '1 '
	print(out * n)


def solve(n):
	for i in range(n - 1):
		print(1, end=' ')
	print(5)
t = int(input())
for _ in range(t):
	inp = input().split()
	n = int(inp[0])
	solve(n)


import math
n = int(input())
for i in range(n):
	t = int(input())
	print(*[1] * t)


t = int(input())
for _ in range(t):
	n = int(input())
	li = []
	x = 1
	y = 3
	if n % 2 == 0:
		z = int(n / 2)
	else:
		z = int(n / 2) + 1
	for i in range(n):
		if i % 2 == 0:
			li.append(x)
		else:
			li.append(y)
	print(*li)


import math
for _ in range(int(input())):
	a = int(input())
	l = [1] * a
	print(*l)


import sys, collections

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
mod = 1000000007
for _ in range(int(input())):
	n = int(input())
	arr = [1] * n
	print(*arr)


t = int(input())
for case in range(0, t):
	n = int(input())
	print('1 ' * n)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(' '.join(['1' for _ in range(n)]))
main()


def main():
	test = int(input())
	for _ in range(test):
		n = int(input())
		for i in range(n):
			print(4, end=' ')
		print()
main()


n = int(input())
for _ in range(n):
	a = int(input())
	print(*[2 if i % 2 else 3 for i in range(a)])


for i in range(int(input())):
	n = int(input())
	v = []
	for i in range(1, n + 1):
		v.append(1)
	print(*v)


import math
import bisect
import copy
import time
from collections import Counter
for _ in range(int(input())):
	n = int(input())
	l = [1] * n
	print(*l)


T = int(input())
for _ in range(T):
	n = int(input())
	ls = [1] * (n // 2)
	ls2 = [3] * (n - n // 2)
	ls += ls2
	print(*ls)


import sys

def solve(a):
	result = [1 for i in range(a)]
	return result
IN = [x.strip() for x in sys.stdin.readlines()]
T = int(IN[0])
cur = 1
for ti in range(T):
	a = int(IN[cur])
	result = solve(a)
	print(' '.join([str(a) for a in result]))
	cur += 1


n = int(input())
l1 = []
for i in range(n):
	l1.append(int(input()))
for i in range(n):
	t = l1[i]
	l2 = []
	for i in range(t):
		l2.append(384)
	print(*l2)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from collections import Counter as cc
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
t = int(input())
for _ in range(t):
	n = int(input())
	print(*[1] * n)


t = int(input())
while t:
	n = int(input())
	ans = [1] * n
	ans = ' '.join((str(i) for i in ans))
	print(ans)
	t -= 1


import sys
input = sys.stdin.readline
MOD = 1000000007
MOD2 = 998244353
ii = lambda : int(input().strip('\n'))
si = lambda : input().strip('\n')
dgl = lambda : list(map(int, input().strip('\n')))
f = lambda : map(int, input().strip('\n').split())
il = lambda : list(map(int, input().strip('\n').split()))
ls = lambda : list(input().strip('\n'))
lsc = lambda : list(input().strip('\n').split(' '))
lsi = lambda : [int(i) for i in ls()]
let = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(ii()):
	n = ii()
	print(*[1] * n)


def solve():
	print(' '.join(('1' for _ in range(int(input())))))

def main():
	for case in range(int(input())):
		solve()
main()


t = int(input())
for e in range(t):
	n = int(input())
	a = []
	while n:
		a.append(2)
		n -= 1
	for i in range(len(a)):
		print(a[i], end=' ')
	print()


t = int(input())

def solve():
	n = int(input())
	print(n * '1 ')
for _ in range(t):
	solve()


def f(n):
	return ' '.join(map(str, [1 for _ in range(n)]))
for i in range(int(input())):
	print(f(int(input())))


t = int(input())
ar = []
for i in range(t):
	n = int(input())
	list1 = [2] * n
	ar.append(list1)
for i in ar:
	s = ' '.join((str(j) for j in i))
	print(s)


T = int(input())
for t in range(T):
	n = int(input())
	print('1 ' * n)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = [1] * n
	for i in range(n):
		if i != n - 1:
			print(ans[i], end=' ')
		else:
			print(ans[i])


from sys import stdin

def inp():
	return stdin.buffer.readline().rstrip().decode('utf8')

def itg():
	return int(stdin.buffer.readline())

def mpint():
	return map(int, stdin.buffer.readline().split())
ans = [87] * 1001
for case in range(itg()):
	print(*ans[:itg()])


T = int(input())
for _ in range(T):
	n = int(input())
	s = [1] * n
	print(*s)


test_case = int(input())
for i in range(test_case):
	l = []
	k = 1
	length = int(input())
	for j in range(1, length + 1):
		l.append(str(1))
		k += j
	print(' '.join(l))


t = int(input())
for _ in range(t):
	n = int(input())
	lis = [1] * n
	print(*lis)


for _ in range(int(input())):
	n = int(input())
	l = [1 for x in range(1, n + 1)]
	print(*l)


T = int(input())
while T != 0:
	T -= 1
	n = int(input())
	for i in range(n):
		print(5, end=' ')
	print()


for t in range(int(input())):
	n = int(input())
	l = ['1'] * n
	print(' '.join(l))


q = int(input())
for i in range(q):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


import sys
sys.setrecursionlimit(10 ** 6)

def proc(n):
	a = [0 for i in range(n)]
	m = n // 2
	for i in range(m):
		a[i + i] = i + i + 1
		a[i + i + 1] = i + i + 1
	if m + m != n:
		a[n - 1] = m + m + 1
	for ai in a:
		print(ai, end=' ')
	print('')
t = int(input())
for ti in range(t):
	n = int(input())
	proc(n)


n = int(input())
for i in range(n):
	m = int(input())
	for i in range(1, m + 1):
		print(1, end=' ')
	print()


from math import *
from itertools import *
from collections import *
import sys
INF = int(100000.0 + 1)
pi = 3.141592653589793

def ii():
	return int(input())

def mas():
	return input().split()

def masint():
	return [int(i) for i in mas()]

def solve():
	n = ii()
	h = [1] * n
	print(*h)

def main():
	t = ii()
	while t:
		solve()
		t -= 1
main()


for _ in range(int(input())):
	n = int(input())
	l = [1] * n
	print(' '.join(map(str, l)))


import os
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from io import BytesIO, IOBase
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def main():
	t = inp()
	for _ in range(t):
		n = inp()
		for i in range(n):
			print(5, end=' ')
		print()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


for i in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		a.append(1)
	print(*a)


import math
from collections import defaultdict, deque
from sys import stdin
from bisect import bisect_left, bisect_right

def mp():
	return map(int, stdin.readline().split())

def ml():
	return list(map(int, stdin.readline().split()))
for _ in range(int(input())):
	n = int(input())
	a = [1] * n
	print(*a)


t = int(input())
while t > 0:
	n = int(input())
	result = [1] * n
	print(*result)
	t -= 1


T = int(input())

def solve():
	N = int(input())
	print(' '.join(['1'] * N))
for _ in range(T):
	solve()


T = int(input())
for i in range(T):
	n = int(input())
	for j in range(n):
		print('2', end=' ')
	print('')


import bisect
import os
import gc
import sys
from io import BytesIO, IOBase
from collections import Counter
from collections import deque
import heapq
import math
import statistics

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

def sain():
	return input().split()

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def main():
	for _ in range(iin()):
		n = iin()
		l = [1] * n
		print(*l)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def main():
	for _ in range(int(input())):
		print('1 ' * int(input()))
main()


def solve():
	n = int(input())
	arr = []
	for i in range(1, n + 1, 2):
		arr.append(i)
	arr.extend(arr)
	while len(arr) > n:
		arr.pop()
	if len(arr) != n:
		raise Exception()
	for x in arr:
		print(x, end=' ')
	print()
t = int(input())
for i in range(t):
	solve()


t = int(input())
temp = 0
for _ in range(t):
	x = int(input())
	arr = [1 for _ in range(x)]
	print(*arr)


t = int(input())
while t:
	n = int(input())
	t -= 1
	for j in range(n):
		print(1, end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	L = [1 for j in range(n)]
	print(*L)


t = int(input())
while t:
	n = int(input())
	li = ''
	for i in range(n):
		li += '1 '
	print(li)
	t -= 1


n = int(input())
for i in range(n):
	z = int(input())
	count = 1
	for i in range(z):
		print(count, end=' ')
		if i % 3 == 2:
			count += 2
	print()


for _ in range(int(input())):
	i_liczb = int(input())
	print('1 ' * i_liczb)


n = int(input())
for i in range(n):
	t = int(input())
	st = '1'
	for j in range(t - 1):
		st += ' 1'
	print(st)


from math import ceil

def main():
	for _ in range(int(input())):
		n = int(input())
		print(' '.join(['1000' for i in range(n)]))
main()


for _ in range(int(input())):
	a = []
	for i in range(int(input())):
		a.append(1)
	print(*a)


from sys import stdin, stdout
import math
from collections import Counter, defaultdict
LI = lambda : list(map(int, input().split()))
MAP = lambda : map(int, input().split())
IN = lambda : int(input())
S = lambda : input()

def case():
	n = IN()
	print('1 ' * n)
for _ in range(IN()):
	case()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	print(*[1] * n)


for i in range(int(input())):
	n = int(input())
	for k in range(n):
		print(1, end=' ')
	print('')


for i in range(int(input())):
	n = int(input())
	print(' '.join([str(1)] * n))


t = int(input())
for i in range(t):
	n = int(input())
	ele = 1
	l = []
	for i in range(n):
		l.append(ele)
	for i in l:
		print(i, end=' ')
	print()


def main():
	for __ in [0] * int(input()):
		N = int(input())
		print(*[1] * N)
main()


n = int(input())
for i in range(n):
	t = int(input())
	l = []
	x = 1
	for j in range(t):
		l.append(x)
	print(*l)


t = int(input())
for _ in range(t):
	n = int(input())
	one = True
	for i in range(n):
		if one is True:
			print(1, end=' ')
			one = False
		else:
			print(3, end=' ')
			one = True
	print()


for _ in range(int(input())):
	a = int(input())
	c = [1 for i in range(2, a + 2)]
	print(' '.join((str(i) for i in c)))


tests = int(input())
for test in range(tests):
	n = int(input())
	ans = ['1'] * n
	print(' '.join(ans))


t = int(input())
for _ in range(t):
	n = int(input())
	result = [1 for i in range(n)]
	print(*result)


n = int(input())
for i in range(n):
	j = int(input())
	print('2 ' * j)


for _ in range(int(input())):
	n = int(input())
	l = [3]
	l = [3] * n
	print(*l)


def solve(n):
	return [1] * n

def main():
	for i in range(int(input())):
		n = int(input())
		print(*solve(n))
main()


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def modefiedSieve():
	mx = 10 ** 7 + 1
	sieve = [-1] * mx
	for i in range(2, mx):
		if sieve[i] == -1:
			sieve[i] = i
			for j in range(i * i, mx, i):
				if sieve[j] == -1:
					sieve[j] = i
	return sieve

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def maxSubArraySum(a, size):
	maxint = 10 ** 10
	max_so_far = -maxint - 1
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def solve():
	n = int(input())
	print('2 ' * n)
t = 1
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for i in range(1, t + 1):
	n = int(input())
	for i in range(1, n + 1):
		if i % 2 == 1:
			print(20, ' ', end='')
		else:
			print(44, ' ', end='')
	print('')


def read_int():
	n = int(input())
	return n

def read_ints():
	ints = [int(x) for x in input().split(' ')]
	return ints

def solve():
	sol = [1, 1]
	while len(sol) < 1000:
		i = sol[-1] + 2
		sol.append(i)
		sol.append(i)
	sol_str = [str(x) for x in sol]
	return sol_str
t = read_int()
arr = solve()
for case in range(t):
	n = read_int()
	sol = arr[:n]
	print(' '.join(sol))


n = int(input())
for i in range(n):
	t = int(input())
	a = []
	b = -1
	for j in range(t):
		if j % 3 == 0:
			b += 2
		a.append(b)
	print(*a, sep=' ')


for i in range(int(input())):
	n = int(input())
	a = []
	for i in range(1000):
		if i % 2 != 0:
			a.append(i)
		if len(a) == n:
			break
	if len(a) < n:
		for i in range(n - len(a)):
			a.append(1)
	print(*a)


for t in range(int(input())):
	n = int(input())
	l = [5] * n
	print(*l)


for _ in range(int(input())):
	a = 384
	b = 44
	flag = 0
	for _ in range(int(input())):
		if flag == 0:
			print(a, end=' ')
			flag = 1
		else:
			print(b, end=' ')
			flag = 0
	print()


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')
file = 0

def solve():
	for _ in range(ii()):
		n = ii()
		a = [1] * n
		print(*a)
if file:
	if path.exists('input1.txt'):
		sys.stdin = open('input1.txt', 'r')
		sys.stdout = open('output1.txt', 'w')
	else:
		input = sys.stdin.readline
solve()


for i in range(int(input())):
	a = int(input())
	b = [1 for j in range(a)]
	print(*b)


T = int(input())
for _ in range(T):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


from sys import stdin, stdout
from math import *
from heapq import *
from collections import *

def main():
	ntest = int(stdin.readline())
	for testcase in range(ntest):
		n = int(stdin.readline())
		stdout.write('%s\n' % ' '.join([str(n)] * n))
	return 0
main()


test = int(input())
t = 0
while t < test:
	want = []
	n = int(input())
	for array in range(n):
		want.append(str(1))
	print(' '.join(want))
	t = t + 1


from sys import stdin
get = lambda : stdin.readline().strip()
getList = lambda : get().split()
getIntList = lambda : [int(var) for var in getList()]
getCharList = lambda : list(get())
(t,) = getIntList()
for _ in range(t):
	(n,) = getIntList()
	ans = []
	for i in range(n // 2 + n % 2):
		ans.append(2 * i + 1)
		ans.append(ans[-1])
	for i in range(n):
		print(ans[i], end=' ')
	print()


size = int(input())
for i in range(size):
	xize = int(input())
	h = 0
	for i in range(xize):
		if h == 10:
			h = 2
		x = h * 2 + 1
		print(x, end=' ')
		h += 1
	print()


for _ in range(int(input())):
	n = int(input())
	a = []
	res = 1
	for i in range(n):
		a.append(str(res))
		res += 2
		if res > 1000:
			res = 1
	print(' '.join(a))


for _ in [0] * int(input()):
	print('1 ' * int(input()))


for test_case in range(int(input())):
	ans = [1] * int(input())
	print(*ans)


from sys import *
t = int(stdin.readline())
while t > 0:
	n = int(stdin.readline())
	for i in range(n):
		print(999, end=' ')
	print()
	t -= 1


t = int(input())
i = 0
while i < t:
	n = int(input())
	k = []
	for s in range(n):
		k.append('1')
	print(' '.join(k))
	i += 1


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	n = int(input())
	print('1' + ' 1' * (n - 1))


t = int(input())
while t != 0:
	s = int(input())
	while s != 0:
		print(1, end=' ')
		s = s - 1
	print()
	t = t - 1


def solve():
	arr = []
	n = int(input())
	while n > 0:
		print('1', end=' ')
		n = n - 1
	print()
t = int(input())
for i in range(t):
	solve()


def tran(n):
	a = [5]
	a = a * n
	return a
t = int(input())
ans = []
for i in range(t):
	n = int(input())
	res = tran(n)
	ans.append(res)
for i in ans:
	print(*i)


def main():
	n = int(input())
	a = [1] * n
	print(*a)
	return

def test():
	t = int(input())
	while t:
		main()
		t -= 1
test()


for n in [*open(0)][1:]:
	print('1 ' * int(n))


for i in range(int(input())):
	n = int(input())
	a = [1] * n
	print(*a, sep=' ')


import time, math as mt, bisect, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

def IO():
	return stdin.readline()

def IP():
	return map(int, stdin.readline().split())

def L():
	return list(map(int, stdin.readline().split()))

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def readTree():
	v = int(input())
	adj = [set() for i in range(v + 1)]
	for i in range(v - 1):
		(u1, u2) = In()
		adj[u1].add(u2)
		adj[u2].add(u1)
	return (adj, v)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * 1000001
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(1000001):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def SPF():
	spf[1] = 1
	for i in range(2, mx + 1):
		if spf[i] == mx:
			spf[i] = i
			for j in range(i * i, mx + 1, i):
				if i < spf[j]:
					spf[j] = i
	return
mod = 10 ** 9 + 7

def solve():
	n = II()
	li = [1 for i in range(n)]
	print(*li)
t = II()
for i in range(t):
	solve()


t = 1
t = int(input())
while t:
	t -= 1
	n = int(input())
	for _ in range(n):
		print(1, end=' ')
	print('')


t = int(input())
for _ in range(t):
	l = int(input())
	for i in range(l):
		print('1', end=' ')
	print()


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = [1] * n
		maxAElement = 1000
		print(*a)
main()


from collections import deque
import copy
for i in range(int(input())):
	n = int(input())
	print('22 ' * n)


x = int(input())
for i in range(x):
	a = int(input())
	c = 2
	l = []
	for j in range(a):
		l.append(c)
	print(*l)


for i in range(int(input())):
	n = int(input())
	array = [1 for i in range(n)]
	print(''.join([f'{i} ' for i in array]))


for x in range(int(input())):
	l = int(input())
	lst = list()
	k = 1
	while l >= 1:
		lst.append(k)
		l = l - 1
	print(*lst)


import random
for _ in range(int(input())):
	n = int(input())
	a = random.randrange(1, 10)
	p = [a] * n
	print(' '.join(map(str, p)))


t = int(input())
for i in range(t):
	n = int(input())
	a = []
	if 1000 % n != 0:
		for i in range(n):
			a.append(int((1000 + n - 10) / n))
	else:
		for i in range(n):
			a.append(int(1000 / n))
	print(*a)


T = int(input())
for _ in range(T):
	N = int(input())
	A = []
	for i in range(N):
		A.append(1)
	print(*A)


from collections import Counter, defaultdict
BS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def to_base(s, b):
	res = ''
	while s:
		res += BS[s % b]
		s //= b
	return res[::-1] or '0'
alpha = 'abcdefghijklmnopqrstuvwxyz'
from math import floor, ceil, pi, log
import sys
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919]
import timeit

def primef(n, plst=[]):
	if n == 1:
		return plst
	else:
		for m in primes:
			if n % m == 0:
				return primef(n // m, plst + [m])
		return primef(1, plst + [n])

def lmii():
	return list(map(int, input().split()))

def ii():
	return int(input())

def countOverlapping(string, sub):
	count = start = 0
	while True:
		start = string.find(sub, start) + 1
		if start > 0:
			count += 1
		else:
			return count

def base10Len(n):
	return len(str(n))
t = int(input())
for i in range(t):
	n = int(input())
	print('1 ' * n)


for i in range(int(input())):
	n = int(input())
	arr = ['1' for i in range(0, n)]
	print(' '.join(arr))


t = int(input())
for test in range(t):
	n = int(input())
	r = [str(1) for i in range(n)]
	print(' '.join(r))


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	n = inputnum()
	for i in range(n):
		print(1, end=' ')
	print()


test = int(input())
for _ in range(test):
	n = int(input())
	l = ['1'] * n
	print(' '.join(l))


t = int(input())
for temp in range(t):
	n = int(input())
	answ = [1] * n
	print(*answ)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(1)
		continue
	a = []
	for i in range(n // 2):
		a.append(2 * i + 1)
		a.append(2 * i + 1)
	if len(a) != n:
		a.append(a[-1] + 2)
	print(*a)


t = int(input())
while t > 0:
	n = int(input())
	print('2 ' * n)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	b = []
	for i in range(n):
		b.append('1')
	print(*b)


t = int(input())
while t != 0:
	n = int(input())
	l = [1 for i in range(n)]
	print(*l)
	t = t - 1


import sys, math
input = lambda : sys.stdin.readline().rstrip()

def meh(m):
	an = 0
	while True:
		if an not in m:
			return an
		else:
			an += 1
for _ in range(int(input())):
	n = int(input())
	s = '1 '
	print(s * n)


import sys
sys.setrecursionlimit(10000)
t = int(input())
for _ in range(t):
	n = int(input())
	a = [1] * n
	print(*a)


for _ in range(int(input())):
	n = int(input())
	l = []
	j = 1
	if n % 2 == 1:
		l.append(1)
		n -= 1
	j = 3
	for i in range(0, n, 2):
		if j > 1000:
			j = 1
		l.append(j)
		l.append(j)
		j += 2
	print(*l)


import sys, collections, math

def in_out():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for _ in range(int(input())):
	n = int(input())
	arr = [1] * n
	print(*arr)


import sys
from collections import defaultdict
from functools import reduce
t = int(input())
for _ in range(t):
	n = int(input())
	a = ['1'] * n
	print(' '.join(a))


t = int(input())
while t > 0:
	n = int(input())
	res = ['1'] * n
	print(' '.join(res))
	t -= 1


from collections import Counter
from collections import defaultdict
from collections import deque
import math
import heapq
import sys
import io, os
input = sys.stdin.readline
from bisect import *
rs = lambda : input().strip()
ri = lambda : int(input())
rl = lambda : list(map(int, input().strip().split()))
rls = lambda : list(map(str, input().split()))
t = int(input())
for _ in range(0, t):
	n = int(input())
	c = -1
	a = []
	for i in range(0, 500):
		c = c + 2
		for j in range(0, 2):
			a.append(c)
	print(*a[:n])


for yeet in range(int(input())):
	for bruh in range(int(input())):
		print(1, end=' ')
	print()


import math
n = int(input())
for _ in range(n):
	a = int(input())
	for i in range(a):
		print('2', end=' ')
	print('')


n = int(input())
I = []
for i in range(n):
	k = int(input())
	I.append(k)

def output(x):
	l = []
	for i in range(x):
		l.append(5)
	return l
for i in range(n):
	print(' '.join((str(i) for i in output(I[i]))))


a = int(input())
while a:
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(1)
	print(*arr)
	a -= 1


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	n = inp()
	for i in range(n):
		print(n, end=' ')
	print()


import sys
input = sys.stdin.buffer.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	l = [1 for i in range(n)]
	print(*l, sep=' ')


tt = int(input())
for i in range(tt):
	b = int(input())
	print('2 ' * b)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [50] * n
	print(*arr)


a = int(input())
i = 0
while i < a:
	b = int(input())
	g = ''
	c = 0
	while c < b:
		g = g + '1'
		g = g + ' '
		c = c + 1
	print(g)
	i = i + 1


from collections import deque
from collections import OrderedDict
import math
import sys
import os
import threading
import bisect
import operator
import heapq
from atexit import register
from io import BytesIO
import io
input = lambda : sys.stdin.readline().rstrip('\r\n')
for t in range(int(input())):
	n = int(input())
	for i in range(n):
		print(44, end=' ')
	print('')


from sys import stdin, stdout

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline()
for _ in range(ii()):
	n = ii()
	l1 = [1] * n
	print(*l1)


t = int(input())
for i in range(t):
	n = int(input())
	ar = []
	for i in range(n):
		ar.append(1)
	print(*ar)


a = int(input())
for _ in range(a):
	x = int(input())
	li = [1] * x
	print(*li)


test = int(input())
for i in range(test):
	inp = int(input())
	for j in range(inp):
		print(1, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [1] * n
	print(*arr)


tt = int(input())
for z in range(tt):
	n = int(input())
	a = [1] * n
	print(*a)


for T in range(int(input())):
	x = int(input())
	for i in range(x):
		print(1, end=' ')
	print()


for t in range(int(input())):
	n = int(input())
	print((str(n) + ' ') * n)


t = int(input())
for j in range(t):
	m = int(input())
	b = []
	while m:
		b.append(9)
		m -= 1
	for i in range(len(b)):
		print(b[i], end=' ')
	print()


t = int(input())
answer = []
for a in range(t):
	n = int(input())
	line = ['1' for i in range(n)]
	answer.append(' '.join(line))
for b in answer:
	print(b)


cases = int(input())
for t in range(cases):
	n = int(input())
	a = [2] * n
	print(*a)


t = int(input())
out = []
for i in range(t):
	n = int(input())
	out.append(n)
for i in range(len(out)):
	for j in range(out[i]):
		print(2, end=' ')
	print()


t = int(input())
arr = []
for i in range(t):
	n = int(input())
	arr.append(n)
for j in range(t):
	for h in range(arr[j]):
		if h == arr[j] - 1:
			print('1')
		else:
			print('1', end=' ')


a = input()
for x in range(int(a)):
	b = input()
	for i in range(int(b)):
		if i != int(b) - 1:
			print(1, end=' ')
		else:
			print(1)


ans = []
for t in range(int(input())):
	m = ['1'] * int(input())
	ans += [' '.join(m)]
print('\n'.join(ans))


import collections
t = int(input())
for _ in range(t):
	for i in range(int(input())):
		print(1, end=' ')
	print()


t = int(input())
while t > 0:
	size = int(input())
	for i in range(size):
		print('1000', end=' ')
	print()
	t -= 1


def test(n):
	a = []
	i = 1
	flag = 0
	for j in range(n):
		flag += 1
		a.append(str(i))
		if flag == 2:
			flag = 0
			i += 2
	return ' '.join(a)
t = int(input())
for i in range(t):
	n = int(input())
	print(test(n))


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	arr = [i for i in range(1, 1000, 2)] * 2
	print(*arr[:n])


t = int(input())
while t:
	n = int(input())
	print('1 ' * n)
	t = t - 1


from sys import stdin, stdout
from collections import Counter
from math import ceil
from bisect import bisect_left
from bisect import bisect_right

def ai():
	return list(map(int, stdin.readline().split()))

def ei():
	return map(int, stdin.readline().split())

def ip():
	return int(stdin.readline().strip())

def op(ans):
	return stdout.write(str(ans) + '\n')
for i in range(ip()):
	n = ip()
	print(*[1] * n)


a = 1
sum1 = []
for i in range(500):
	for j in range(2):
		sum1.append(a)
	a += 2
for i in range(int(input())):
	n = int(input())
	f = []
	for i in range(n):
		f.append(sum1[i])
	print(*f)


t = int(input())
while t != 0:
	n = int(input())
	net = [1000 for i in range(n)]
	print(*net)
	t -= 1


t = int(input())
for i in range(t):
	a = []
	n = int(input())
	for j in range(n):
		a = [1] * n
	print(*a)


t = int(input())
for i in range(t):
	num = int(input())
	l = [print('1', end=' ') for j in range(num)]
	print()


import sys
import math
import bisect
from sys import stdin
from itertools import groupby
from heapq import heapify, heappop, heappush
from collections import deque, Counter, OrderedDict

def neo():
	return map(int, input().split())

def Neo():
	return list(map(int, input().split()))
for _ in range(int(input())):
	N = int(input())
	print(*list('1' * N))


from sys import stdin as cin

def main():
	t = int(next(cin).strip())
	for i in range(t):
		n = int(next(cin).strip())
		print(' '.join(['1'] * n))
main()


k = int(input())
for i in range(k):
	n = int(input())
	a = [1 for item in range(n)]
	print(*a, sep=' ')


import math
I = lambda : list(map(int, input().split(' ')))
for _ in range(int(input())):
	n = int(input())
	print(' '.join(map(str, [1] * n)))


for _ in range(int(input())):
	n = int(input())
	a = []
	i = 0
	j = 1
	while i < n:
		a.append(j)
		i += 1
		if i == n:
			break
		else:
			a.append(j)
			i += 1
		j += 2
	for i in a:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = [1, 3] * (n // 2)
	if n % 2:
		a += [1]
	print(*a)


T = int(input())
for t in range(1, T + 1):
	N = int(input())
	for i in range(N):
		print(1, ' ', end='')
	print()


ok = int(input())
for i in range(ok):
	n = int(input())
	li = []
	for i in range(n):
		li.append(10)
	print(*li, sep=' ')


for _ in range(int(input())):
	i = 1
	n = int(input())
	ar = [1] * n
	print(*ar)


def solve(n):
	res = [1 for i in range(0, n)]
	print(' '.join(map(str, res)))
	pass
t = int(input())
for i in range(t):
	n = int(input())
	solve(n)


import math
from decimal import Decimal
import heapq
import copy
import heapq
from collections import deque

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def da():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	return (n, m, a)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def lol(lst, k):
	k = k % len(lst)
	ret = [0] * len(lst)
	for i in range(len(lst)):
		if i + k < len(lst) and i + k >= 0:
			ret[i] = lst[i + k]
		if i + k >= len(lst):
			ret[i] = lst[i + k - len(lst)]
		if i + k < 0:
			ret[i] = lst[i + k + len(lst)]
	return ret

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)

def fact(n):
	tc = []
	ans = {}
	d = 2
	while d * d <= n:
		if n % d == 0:
			tc.append(d)
			n //= d
		else:
			d += 1
	if n > 1:
		tc.append(n)
	for i in tc:
		ans[i] = ans.get(i, 0) + 1
	return ans

def how_many(l, r, c):
	m = (l + r) // 2
	if r - l == 1:
		if s[l] == c:
			return 0
		else:
			return 1
	d = s[l:m]
	k1 = (r - l) // 2 - s[l:m].count(c) + how_many(m, r, chr(ord(c) + 1))
	k2 = (r - l) // 2 - s[m:r].count(c) + how_many(l, m, chr(ord(c) + 1))
	return min(k1, k2)
for _ in range(int(input())):
	n = int(input())
	a = [1] * n
	print(*a)


from sys import stdin
t = int(stdin.readline().strip())
for i in range(t):
	n = int(stdin.readline().strip())
	print(*[1] * n)


num = int(input(''))
for i in range(num):
	n = int(input(''))
	ans = []
	for i in range(n):
		ans.append(1)
	answer = [str(i) for i in ans]
	print(' '.join(answer))


t = int(input())
while t != 0:
	n = int(input())
	a = []
	for i in range(n):
		a.append(n)
	print(*a)
	t = t - 1


t = int(input())
for s in range(t):
	n = int(input())
	print('1 ' * n)


def solve(n):
	return [1] * n
t = int(input())
for _ in range(t):
	n = int(input())
	print(' '.join(map(str, solve(n))))


t = int(input())
for _ in range(t):
	print(('2 ' * int(input()))[:-1])


for _ in range(int(input())):
	w = int(input())
	l = ['1'] * w
	print(*l, sep=' ')


t = int(input())
i = 0
while i < t:
	n = int(input())
	j = 0
	while j < n:
		print(n, end=' ')
		j += 1
	print()
	i += 1


for h in range(int(input())):
	n = int(input())
	print(*[1] * n)


for ttt in range(int(input())):
	n = int(input())
	print(*[1] * n)


t = int(input())
while t > 0:
	n = int(input())
	o = True
	for i in range(n):
		if o:
			print(1, end=' ')
			o = False
		else:
			print(3, end=' ')
			o = True
	print()
	t -= 1


n = int(input())
for i in range(n):
	s = int(input())
	for j in range(s):
		print('1', end=' ')
	print()


for tt in range(int(input())):
	n = int(input())
	ans = []
	for i in range(n):
		ans.append(1)
	print(*ans)


import math
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	num = int(input())
	ans = [1] * num
	print(*ans)


for _ in range(int(input())):
	l = []
	n = int(input())
	for i in range(1, n // 2 + 1):
		l.append(1)
	for i in range(n // 2, n):
		l.append(3)
	for i in l:
		print(i, end=' ')
	print()


t = int(input())
for x in range(t):
	n = int(input())
	print(' '.join(('1' for i in range(n))))


for _ in range(int(input())):
	x = int(input())
	for i in range(x):
		print(1, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	if n % 2 == 0:
		print(*[5] * (n // 2) + [20] * (n // 2))
	else:
		print(*[5] * (n // 2 + 1) + [20] * (n // 2))


t = int(input())
for _ in range(t):
	n = int(input())
	ar = [1] * n
	print(*ar)


import os
import sys
from io import BytesIO, IOBase

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		lst = [1] * n
		print(*lst)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for i in range(t):
	val = 1
	arr = []
	n = int(input())
	for i in range(n):
		if val > 1000:
			val = 1
		print(val, end=' ')
		val = val * 3
	print('')


t = int(input())
nums = []
for i in range(t):
	nums.append(int(input()))
output = []
for num in nums:
	output.append([1] * num)
for out in output:
	print(*out)


tt = int(input())
for _ in range(tt):
	nn = int(input())
	for i in range(nn):
		print(1, end=' ')
	print()


t = int(input())
res = dict()
for cases in range(t):
	n = int(input())
	lst = [0] * n
	for i in range(0, n, 2):
		lst[i] = 1
	for j in range(1, n, 2):
		lst[j] = 200
	res[cases] = lst
for k in range(t):
	l = res[k]
	print(' '.join((str(i) for i in l)))


def solve(n, A):
	result = ''
	return result

def main():
	T = int(input())
	for i in range(1, T + 1):
		n = int(input())
		result = ['1'] * n
		print(' '.join(result))
main()


for i in range(int(input())):
	n = int(input())
	l1 = [1] * n
	for j in range(n):
		print(l1[j], end=' ')
	print('\n', end='')


def solve(n):
	res = []
	for j in range(n):
		res.append(1)
	return res
t = int(input())
while t:
	n = int(input())
	print(*solve(n))
	t -= 1


test = int(input())
for _ in range(test):
	n = int(input())
	k = 1
	for i in range(n):
		print(k, end=' ')
	print()


k = int(input())
for i in range(k):
	po = [1]
	a = int(input())
	jo = po * a
	print(*jo)


def solve1():
	n = int(input())
	print('1 ' * n)
for _ in range(int(input())):
	solve1()


for _ in range(int(input())):
	print('1 ' * (int(input()) - 1), '1', sep='')


n = int(input())
for i in range(n):
	x = int(input())
	for j in range(x):
		print('1', end=' ')
	print()


import sys
input = sys.stdin.readline
T = int(input())
for testcase in range(T):
	n = int(input())
	print(*[1] * n)


t = int(input().split()[0])
for case in range(t):
	n = int(input().split()[0])
	arr = [1] * n
	print(*arr)


for _ in range(int(input())):
	n = int(input())
	if n < 500:
		for i in range(1, 2 * n, 2):
			print(i, end=' ')
	else:
		for i in range(n):
			print('1', end=' ')
	print()


T = int(input())
for i in range(T):
	n = int(input())
	j = 0
	while j < n:
		if j == n - 1:
			print(1, end='')
		else:
			print(1, end=' ')
		j += 1
	print('')


for i in range(int(input())):
	numberOfOnes = int(input())
	print('1 ' * numberOfOnes)


def solve(l):
	return ' '.join(map(str, [1] * l))

def main():
	t = int(input())
	for _ in range(t):
		l = int(input())
		print(solve(l))
main()


t = int(input())
for i in range(t):
	v = int(input())
	for j in range(v):
		print(1, end=' ')
	print('')


import sys
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	n = int(input())
	a = [1] * n
	print(*a)


t = int(input())
for i in range(t):
	n = int(input())
	a = [str(1)] * n
	print(' '.join(a))


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append(1)
	print(*l, sep=' ')


t = int(input())
for i in range(t):
	n = int(input())
	a = []
	for j in range(n):
		if j % 2 == 0:
			a.append(1)
		else:
			a.append(5)
	print(*a)


n = int(input())
for i in range(n):
	n1 = int(input())
	for i in range(n1):
		print(900, end=' ')
	print('')


t = int(input())
lst = []
for i in range(t):
	n = int(input())
	temp = [1]
	for i in range(1, n):
		temp.append(2 * (i % 3) + 1)
	lst.append(temp)
for i in range(len(lst)):
	for j in range(len(lst[i])):
		print(lst[i][j], end=' ')
	print()


t = int(input())
while t:
	t -= 1
	n = int(input())
	arr = [1 for i in range(n)]
	print(*arr)


def ques1(n):
	l = [1 for i in range(n)]
	print(*l)
t = int(input())
for i in range(t):
	n = int(input())
	ans = ques1(n)
	ans


for i in range(int(input())):
	n = int(input())
	ans = [1] * n
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(1, sep=' ', end=' ')
	print()


t = int(input())
for T in range(t):
	n = int(input())
	l = [99 for x in range(n)]
	print(*l)


import sys
import math

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		a.append(n)
	print(*a)


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
mp = lambda : list(map(int, cin().split()))
(t,) = mp()
for _ in range(t):
	(n,) = mp()
	for i in range(n):
		cout('1 ')
	cout('\n')


import sys
import random
from fractions import Fraction
from math import *

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def finput():
	return float(input())

def tinput():
	return input().split()

def linput():
	return list(input())

def rinput():
	return map(int, tinput())

def fiinput():
	return map(float, tinput())

def rlinput():
	return list(map(int, input().split()))

def trinput():
	return tuple(rinput())

def srlinput():
	return sorted(list(map(int, input().split())))

def NOYES(fl):
	if fl:
		print('NO')
	else:
		print('YES')

def YESNO(fl):
	if fl:
		print('YES')
	else:
		print('NO')

def main():
	n = iinput()
	print(*[1 for i in range(n)])
for i in range(iinput()):
	main()


def ans(n):
	arr = []
	for _ in range(n):
		arr.append(1)
	return arr
t = int(input())
for i in range(t):
	n = int(input())
	a = ans(n)
	print(*a, sep=' ')


from pprint import pprint
import sys
input = sys.stdin.readline
q = int(input())
import math
res = []
for i in range(501, 1001):
	res.append(i)
	res.append(i)
res.append(1)
res.append(1)
res.append(3)
res.append(3)
for _ in range(q):
	n = int(input())
	print(' '.join(list(map(str, res[:n]))))


for _ in range(int(input())):
	n = int(input())
	li = list()
	fg = 0
	if n % 2 == 1:
		n = n + 1
		fg = 1
	a = 1
	for i in range(n // 2):
		li.append(a)
		a += 2
	li += reversed(li)
	if fg == 1:
		li.pop()
	print(*li)


from sys import stdin, gettrace
if gettrace():
	inputi = input
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

def solve():
	n = int(input())
	print('1 ' * n)

def main():
	t = int(inputi())
	for _ in range(t):
		solve()
main()


for test in range(0, int(input())):
	n = int(input())
	arr = []
	for i in range(0, n):
		arr.append(1)
	print(*arr)


T = int(input())
for _ in range(T):
	n = int(input())
	a = [1 for i in range(n)]
	print(*a, sep=' ')


N = int(input())
for i in range(N):
	lst = []
	t = int(input())
	hf = t // 2
	rest = t - hf
	lst = [384] * hf + [44] * rest
	print(*lst)


import sys
import math
import bisect
import heapq
from bisect import bisect_right
from sys import stdin, stdout

def get_ints_in_variables():
	return map(int, sys.stdin.readline().strip().split())

def get_int():
	return int(sys.stdin.readline())

def get_ints_in_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

def get_string():
	return sys.stdin.readline().strip()

def Solution():
	pass

def main():
	for _ in range(get_int()):
		n = get_int()
		for _ in range(1, n + 1):
			print(1, end=' ')
		print()
main()


for _ in range(int(input())):
	ls = [str(25) for i in range(int(input()))]
	print(' '.join(ls))


from sys import stdin, stdout
INF = 100000000000.0
import bisect

def get_int():
	return int(stdin.readline().strip())

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_string():
	return stdin.readline().strip()

def op(c):
	return stdout.write(c)
for _ in range(int(stdin.readline())):
	n = get_int()
	a = 1
	b = 10
	for i in range(n):
		if i % 2 == 0:
			print(a, end=' ')
		else:
			print(b, end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	l = []
	for j in range(n):
		l.append(1)
	for j in range(len(l)):
		if j == len(l) - 1:
			print(l[j])
		else:
			print(l[j], end=' ')


N = int(input())
for _ in range(N):
	n = int(input())
	for _ in range(n):
		print('1', end=' ')
	print()


no_of_testcases = int(input())
test_cases = []
for i in range(no_of_testcases):
	arr_len = int(input())
	test_cases.append(arr_len)
for i in range(no_of_testcases):
	for j in range(test_cases[i]):
		if j == test_cases[i] - 1:
			print('1')
		else:
			print('1 ', end='')


cases = int(input())
for _ in range(cases):
	length = int(input())
	print(' '.join(['1'] * length))


for i in range(int(input())):
	n = int(input())
	a = [999] * n
	for j in a:
		print(j, end=' ')
	print()


t = int(input())
for test in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(1)
	print(' '.join((str(i) for i in arr)))


for _ in range(int(input())):
	a = ''
	for _ in range(int(input())):
		a = a + '1 '
	print(a)


n = int(input())
for t in range(n):
	x = int(input())
	ans = [1] * x
	print(*ans)


n = int(input())
for i in range(n):
	e = int(input())
	for x in range(0, e):
		print(1, end=' ')
	print()


import sys
import math
import random
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	n = inp()
	ara = []
	last = 1
	for i in range(n):
		if last > 1000:
			last = 1
		ara.append(last)
		last += 2
	random.shuffle(ara)
	print(*ara)


for t in range(int(input())):
	lst1 = []
	N = int(input())
	for i in range(1, N + 1):
		lst1.append(1)
	print(' '.join(map(str, lst1)))


import random
t = int(input())
for z in range(t):
	x = []
	n = int(input())
	for j in range(n):
		x.append(int(1))
	print(*x)


n = int(input())
for i in range(n):
	x = int(input())
	for i2 in range(x):
		print(1, end=' ')
	print()


test = int(input())

def solve():
	n = int(input())
	p = []
	s = 0
	for x in range(n):
		k = 2 * x + 1
		if k < 1000:
			p.append(2 * x + 1)
		else:
			p.append(2 * s + 1)
			s += 1
	print(*p)
for x in range(test):
	solve()


for _ in range(int(input())):
	print(*[1 for i in range(int(input()))])


from sys import stdin

def input():
	return stdin.readline()
for _ in range(int(input())):
	n = int(input())
	a = [1] * n
	print(*a)


for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		a.append(n)
	print(*a)


for i in range(int(input())):
	a = int(input())
	for j in range(a):
		if j < a - 1:
			print(1, end=' ')
		else:
			print(1)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	a = []
	c = 0
	i = 501
	if n % 2 == 0:
		y = 2
	else:
		y = 3
	while i <= 1000 and c <= n - y:
		a.append(i)
		a.append(i)
		c = c + 2
		i = i + 1
	if y == 3:
		a.append(i)
	for i in a:
		print(i, end=' ')
	print()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def sieve_of_eratosthenes(n):
	ans = []
	arr = [1] * (n + 1)
	(arr[0], arr[1], i) = (0, 0, 2)
	while i * i <= n:
		if arr[i] == 1:
			j = i + i
			while j <= n:
				arr[j] = 0
				j += i
		i += 1
	for k in range(n):
		if arr[k] == 1:
			ans.append(k)
	return ans

def nc2(x):
	if x == 1:
		return 0
	else:
		return x * (x - 1) // 2

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def mex(li):
	check = [0] * 1001
	for i in li:
		check[i] += 1
	for i in range(len(check)):
		if check[i] == 0:
			return i
from math import *
for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(1000, end=' ')
	print('')


import random
for _ in range(int(input())):
	n = int(input())
	a = random.randint(1, 1000)
	for __ in range(n):
		print(a, end=' ')
	print()


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		i = 1
		k = 0
		s = ''
		while n > 0:
			s += str(i) + ' '
			k += 1
			if k > 1:
				i += 2
				k = 0
			n -= 1
		print(s)
main()


t = int(input())
cases = []
for i in range(t):
	cases.append(int(input()))

def solve(case):
	print(' '.join(('1' for i in range(case))))
for case in cases:
	solve(case)


for _ in range(0, int(input())):
	n = int(input())
	print(' '.join((str(x) for x in [1 for i in range(0, n)])))


try:
	for _ in range(int(input())):
		n = int(input())
		for i in range(n):
			print(1, end=' ')
		print()
except:
	pass


t = int(input())
for _ in range(t):
	n = int(input())
	L = [1] * n
	print(*L)


t = int(input())
for x in range(t):
	n = int(input())
	a = '1' * n
	print(*a, sep=' ')


a = int(input())
for x in range(a):
	b = int(input())
	for x in range(b):
		print(1, end=' ')
	print()


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin
from bisect import bisect_right, bisect_left
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def factorial(n):
	if n == 0:
		return 1
	return n * factorial(n - 1)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return len(set(factors))

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def printAllSubstrings(s, n):
	l = {}
	for i in range(n):
		temp = ''
		for j in range(i, n):
			temp += s[j]
			if temp not in l:
				l[temp] = 0
			l[temp] += 1
	return l
MOD = 1000000007
PMOD = 998244353
T = 1
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	print(*[1] * n)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	n = int(inp())
	a = [1] * n
	print(*a)
testcase(int(inp()))


for i in range(int(input())):
	oo = int(input())
	print('1 ' * oo)


import sys

def input():
	return sys.stdin.readline().rstrip()

def input_split():
	return [int(i) for i in input().split()]
testCases = int(input())
answers = []
for _ in range(testCases):
	n = int(input())
	ans = [1] * n
	answers.append(ans)
for ans in answers:
	print(*ans, sep=' ')


def Solve(n):
	if n == 1:
		print(1)
	else:
		arr = [2] * n
		for i in arr:
			print(i, end=' ')
		print()
T = int(input())
for _ in range(T):
	n = int(input())
	Solve(n)


t = int(input())
for _ in range(t):
	x = int(input())
	for i in range(x):
		print(2, end=' ')
	print()


cases = int(input())
for i in range(cases):
	a = input()
	for i in range(int(a)):
		print(1, end=' ')
	print()


from math import *
from copy import *
from string import *
from random import *
from sys import stdin, stdout
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math
import math
import time
from queue import Queue

def seive(n):
	l = [True]
	l = l * (n + 1)
	for i in range(2, int(sqrt(n)) + 1):
		if l[i] == True:
			val = i * i
			while val < len(l):
				l[val] = False
				val += i
	prime = []
	for i in range(2, len(l)):
		if l[i] == True:
			prime.append(i)
	return prime

def dp(l, i, n, val, ans):
	if i >= n or val < 0:
		return 1000000
	elif val == 0:
		return 0
	else:
		if ans[i] == 1000000:
			ans[i] = min(min(1 + dp(l, i + 1, n, val - l[i], ans), 1 + dp(l, i, n, val - l[i], ans)), dp(l, i + 1, n, val, ans))
		return ans[i]
from queue import Queue

def factors(n):
	l = []
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def check1(s, v, x):
	while True:
		if v not in s:
			return v
		else:
			v -= 1

def check2(s, v, x):
	while True:
		if v not in s:
			return v
		else:
			v += 1

def up(n):
	j = n - 1
	while j > 0:
		if n % j == 0:
			break
		j -= 1
	return j

def fac(n):
	c = 1
	i = 1
	while i <= n:
		c *= i
		i += 1
	return c

def check_happy(n):
	ss = set()
	print(n)
	while n != 1:
		val = n
		s = 0
		print(val)
		while val != 0:
			s += (val % 10) ** 2
			val = val // 10
		print(val)
		print('hi')
		if val in ss:
			return False
		else:
			n = val
			ss.add(n)
	return True

def update(a, b):
	c = 1
	val = a
	while a < b:
		print(c, a)
		c += c
		a += a
	print(1)
	while a > b:
		print()
		a -= val
		c -= 1
	return c
import random as rand
t = int(input())
for i in range(t):
	n = int(input())
	l = [1] * n
	print(*l)


t = int(input())
for _ in range(t):
	n = int(input())
	for _ in range(n):
		print(999, end=' ')
	print()


import sys
input = sys.stdin.readline
t = int(input())
l = [501 for x in range(500)]
l += [502 for x in range(500)]
for _ in range(t):
	a = int(input())
	n = list(l)
	print(*n[:a])


t = int(input())
while t:
	n = int(input())
	res = []
	n1 = n
	while n:
		print(3, end=' ')
		n -= 1
	print()
	t -= 1


a = int(input())
for i in range(a):
	s = int(input())
	ans = [1] * s
	print(*ans)


import math
import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	ar = [1] * n
	[print(ar[i], end=' ') for i in range(n)]
	print()


from sys import stdin, stdout
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
for _ in range(I()):
	n = I()
	print('4 3 ' * (n >> 1) + '4' * (n & 1))


for u in range(int(input())):
	n = int(input())
	x = [1] * n
	print(*x)


for i in range(int(input())):
	n = int(input())
	array = [1] * n
	print(*array, sep=' ')


import sys
from collections import deque
input = sys.stdin.readline

def solve(N):
	result = deque()
	for i in range(1, N + 1):
		result.append(i - (i + 1) % 2)
	return result

def main():
	t = int(input())
	for _ in range(t):
		N = int(input())
		print(*solve(N))
main()


for _ in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(100)
	print(*arr)


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	n = int(input())
	ans = [1] * n
	print(*ans)


from __future__ import division, print_function
import os, sys
import math
import collections
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

class my_dictionary(dict):

	def __init__(self):
		self = dict()

	def add(self, key, value):
		self[key] = value

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r))

def binary_search(arr, low, high, x):
	if high >= low:
		mid = (high + low) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return binary_search(arr, low, mid - 1, x)
		else:
			return binary_search(arr, mid + 1, high, x)
	else:
		return -1

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def padded_bin_with_complement(x):
	if x < 0:
		return bin(2 ** 16 - abs(x))[2:].zfill(16)
	else:
		return bin(x)[2:].zfill(16)

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	print(decimal)

def CountFrequency(my_list):
	freq = {}
	for item in my_list:
		if item in freq:
			freq[item] += 1
		else:
			freq[item] = 1
	return freq

def pos(a):
	b = [0] * len(a)
	c = sorted(a)
	for i in range(len(a)):
		for j in range(len(a)):
			if c[j] == a[i]:
				b[i] = j
				break
	return b

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n

def commonn(a, b, n):
	c = []
	for i in range(n):
		if a[i] == b[i]:
			c.append('-1')
		else:
			c.append(b[i])
	return c

def primeFactors(n):
	j = []
	while n % 2 == 0:
		j.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			j.append(int(n))
			n = n / i
	if n > 2:
		j.append(int(n))
	return j

def sumdigit(n):
	n = str(n)
	k = 0
	for i in range(len(n)):
		k += int(n[i])
	return k

def main():
	for _ in range(ii()):
		n = ii()
		a = [1] * n
		print(*a)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for k in range(t):
	n = int(input())
	print('69 ' * n)


t = int(input())
for test in range(t):
	n = int(input())
	print(*[1 for _ in range(n)])


for _ in range(int(input())):
	n = int(input())
	arr = []
	for i in range(1, n + 1):
		arr.append(1)
	print(' '.join([str(x) for x in arr]))


import sys

def read():
	return sys.stdin.readline()

def write(x):
	sys.stdout.write(str(x) + '\n')

def main():
	t = int(read())
	while t:
		n = int(read())
		write('1 ' * n)
		t -= 1
main()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for _ in range(ii()):
	n = ii()
	print(*[1] * n)


from __future__ import division, print_function
from sys import stdin, stdout
import bisect
import math
import heapq
i_m = 9223372036854775807

def inin():
	return int(input())

def stin():
	return input()

def spin():
	return map(int, stin().split())

def lin():
	return list(map(int, stin().split()))

def matrix(n):
	return [list(map(int, input().split())) for i in range(n)]

def count2Dmatrix(i, list):
	return sum((c.count(i) for c in list))

def modinv(n, p):
	return pow(n, p - 2, p)

def GCD(x, y):
	x = abs(x)
	y = abs(y)
	if min(x, y) == 0:
		return max(x, y)
	while y:
		(x, y) = (y, x % y)
	return x

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l
prime = []

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j
for _ in range(inin()):
	n = inin()
	print(*[1] * n)


for _ in range(int(input())):
	n = int(input())
	i = 0
	lists = [1]
	while i < n - 1:
		lists.append(1)
		i = i + 1
	print(*lists)


for _ in range(int(input())):
	n = int(input())
	a = []
	k = 1
	f = n
	if n % 2 == 1:
		f = n - 1
	for i in range(0, f, 2):
		a.append(k)
		a.append(k)
		k += 2
	if n % 2 == 1:
		a.append(k)
	print(*a)


t = int(input())
for i in range(t):
	n = int(input())
	print('33 ' * n)


import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s)
	sys.stdout.write('\n')

def wi(n):
	sys.stdout.write(str(n))
	sys.stdout.write('\n')

def wia(a, sep=' '):
	sys.stdout.write(sep.join([str(x) for x in a]))
	sys.stdout.write('\n')

def solve(n, k):
	return 0

def main():
	for _ in range(ri()):
		n = ri()
		wia([1] * n)
main()


def read_line(type=int):
	return list(map(type, input().split()))

def sum_from_1_to_(i):
	return i * (i + 1) // 2

def is_odd(a):
	return a % 2 == 0
t = int(input())
for _ in range(t):
	n = int(input())
	print(*[1] * n)


n = int(input())
for i in range(n):
	x = int(input())
	y = ['1'] * x
	print(' '.join(y))


n = int(input())
cases = [int(input()) for _ in range(n)]
for i in cases:
	lst = [1] * i
	[print(_, end=' ') for _ in lst]
	print('')


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
num = inp()
for i in range(0, num):
	len_arr = inp()
	a = 2
	for j in range(0, len_arr - 1):
		print(a, end=' ')
	print(a)


for _ in range(int(input())):
	n = input()
	for __ in range(int(n)):
		print(1, end=' ')
	print()


rr = lambda : input().strip()
rri = lambda : int(stdin.readline())
rrm = lambda : [int(x) for x in rr().split()]
from sys import stdin, stdout

def sol():
	n = rri()
	n -= 1
	lis = [1] * n
	print(*lis, end=' ')
	print(999)
	return
T = rri()
for t in range(1, T + 1):
	sol()


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
	n = int(input())
	arr = [str(1) for x in range(n)]
	print(' '.join(arr))


def solve():
	n = int(input())
	print('1 ' * n)
for i in range(int(input())):
	solve()


t = int(input())
i = 0
while i < t:
	n = int(input())
	a = []
	k = 0
	while k < n:
		a.append(10)
		k = k + 1
	print(*a)
	i = i + 1


for _ in range(int(input())):
	n = int(input())
	ans = [3] * n
	print(*ans)


n = int(input())

def main():
	x = int(input())
	ret = [1] * x
	return ret
ans = []
for _ in range(n):
	a = main()
	ans.append(a)
for a in ans:
	print(*a)


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	n = ri()
	print(*[1] * n)
mode = 'T'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


input_t = int(input())
for i in range(input_t):
	input_n = int(input())
	for i in range(input_n):
		print(1, end=' ')
	print()


t = int(input())
for you in range(t):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


def testcase():
	n = int(input())
	arr = [1 for _ in range(n)]
	for a in arr:
		print(a, end=' ')
	print()
t = int(input())
for _ in range(t):
	testcase()


rw = int(input())
for qerw in range(rw):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print('')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [2 for _ in range(n)]
	print(*a)


p = int(input())
for i in range(0, p):
	q = int(input())
	k = 1
	l = []
	for j in range(0, q):
		l.append(1)
	l = [str(u) for u in l]
	print(' '.join(l))


for i in range(int(input())):
	n = int(input())
	li = [5] * n
	for i in li:
		print(i, end=' ')
	print()
	continue


import os
import heapq
import sys
import math
import bisect
import operator
from collections import defaultdict
from io import BytesIO, IOBase

def prime_factors(n):
	i = 2
	factors = set()
	while i * i <= n:
		if n % i:
			i += 1
		else:
			factors.add(n // i)
			n = n // i
			factors.add(i)
	if n > 1:
		factors.add(n)
	return factors

def isPrime(n):
	if n == 2 or n == 3:
		return True
	if n % 2 == 0 or n < 2:
		return False
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True

def inar():
	return [int(k) for k in input().split()]

def main():
	for _ in range(int(input())):
		n = int(input())
		for i in range(n):
			print(n, end=' ')
		print()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	out = ['1'] * n
	print(*out)


t = int(input())

def primes(n):
	count = 0
	rl = 0
	while n % 2 == 0:
		n = n // 2
		count += 1
	while n % 3 == 0:
		n = n // 3
		rl += 1
	if n != 1 or count > rl:
		return -1
	else:
		return [rl, count]

def fff(n):
	n = str(n)
	sums = 0
	for tl in n:
		sums += int(tl)
	return sums
from math import *
for xy in range(t):
	n = int(input())
	arr = ['1'] * n
	print(' '.join(arr))


def OmkarandCompletion(n):
	string = ''
	for i in range(n):
		string += '1 '
	return string
Lista = []
total = int(input())
for i in range(total):
	Lista.append(int(input()))
for j in Lista:
	print(OmkarandCompletion(j))


test = int(input())
for t in range(test):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	c = 0
	for i in range(n):
		if i % 2 != 0:
			print(1, end=' ')
		else:
			print(3, end=' ')
	print()


from sys import stdin

def solve(n):
	print(*[1] * n)
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	solve(n)


def foo():
	n = int(input())
	g = [2] * n
	print(*g)
for _ in range(int(input())):
	foo()


n = int(input())
count = []
for i in range(n):
	size = int(input())
	count.append(size)
for i in count:
	list = []
	for j in range(i - 1):
		print('1', end=' ')
	print('1')


t = int(input())
while t:
	n = int(input())
	x = 1
	for i in range(n):
		print(x, end=' ')
		x = x + 2
		if x == 1001:
			x = 1
	print()
	t = t - 1


t = int(input())
while t > 0:
	n = []
	m = int(input())
	for i in range(m):
		n.append('1')
	print(' '.join(n))
	t -= 1


import math

def shrey():
	n = int(input())
	a = []
	for i in range(1, n + 1):
		a.append(1)
	for i in range(len(a)):
		print(a[i], end=' ')
	print()
T = input()
T = int(T)
for q in range(1, T + 1):
	shrey()


import sys
import math
strInp = lambda : input().strip().split()
intInp = lambda : list(map(int, strInp()))
for t in range(int(input())):
	n = int(input())
	ans = [2] * n
	print(*ans)


t = int(input())
for ty in range(t):
	n = int(input())
	for j in range(n - 1):
		print(1, end=' ')
	print(1)


num = int(input())
arr = []
for i in range(num):
	arr.append(int(input()))
for i in range(len(arr)):
	b = [1] * int(arr[i])
	print(*b, sep=' ')


import collections
t = int(input())
se = set()
for i in range(t):
	n = int(input())
	for j in range(n):
		print(1, end=' ')
	print()


n = int(input())
lengs = []
for i in range(n):
	lengs.append(int(input()))
masses = []
for leng in lengs:
	masses.append([])
	app = 1000
	for i in range(leng):
		masses[len(masses) - 1].append(str(1000))
		app -= 1
for i in range(len(masses)):
	st = ' '.join(masses[i])
	print(st)


t = int(input())
for i in range(t):
	n = int(input())
	nums = []
	for i in range(n):
		nums.append(1)
	for i in nums:
		print(i, end=' ')
	print('')


for i in range(int(input())):
	n = int(input())
	l = []
	m = 500
	for i in range(n // 2 + 1):
		l.append(m)
		l.append(m)
		m += 1
	for i in range(n):
		print(l[i], end=' ')
	print()


for _ in range(int(input())):
	size = int(input())
	lst = [1] * size
	print(*lst)


from __future__ import division, print_function
import itertools, os, sys, threading
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
from random import randrange
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def main():
	for _ in range(int(input())):
		print(*[1] * int(input()))
main()


t = int(input())
for i in range(t):
	n = int(input())
	p = 1
	for j in range(n):
		print(p, end=' ')
		if j % 2 == 1:
			p += 2
	print()


import sys
import math
from collections import defaultdict as dd
mod = 1000000007
T = 1
T = int(sys.stdin.readline())
for _ in range(T):
	n = int(input())
	l = [1] * n
	print(*l)


import sys
input = sys.stdin.buffer.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	k = 1
	for i in range(n):
		print(k, end=' ')
	print()


n = int(input())
l = [1]
for i in range(n):
	m = int(input())
	a = l * m
	print(*a)


t = int(input())
for case in range(t):
	n = int(input())
	print(' '.join(['1'] * n))


for t in range(int(input())):
	n = int(input())
	for i in range(0, n):
		print(1, end=' ')
	print()


import sys
input = sys.stdin.readline
RI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw = lambda : input().strip().split()
from collections import defaultdict as df
t = int(input().strip())
for _ in range(t):
	n = int(input().strip())
	for i in range(n):
		print(2, end=' ')
	print()


for I in range(int(input())):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


def complete_ar(n):
	ar = []
	for i in range(1, n + 1):
		if i % 2 == 0:
			ar.append(1)
		else:
			ar.append(3)
	return ar
t = int(input())
for i in range(t):
	n = int(input())
	ar = complete_ar(n)
	print(*ar, sep=' ')


for j in range(int(input())):
	a = int(input())
	count = 0
	while count < a:
		print(1, end=' ')
		count += 1
	print('')


t = int(input())
for t1 in range(t):
	n = int(input())
	a = [1] * n
	print(*a)


T = int(input())
for tc in range(T):
	N = int(input())
	listi = []
	a = 3
	j = 8
	for i in range(N):
		if i % 2 == 0:
			listi.append(a)
		else:
			listi.append(j)
	print(*listi)


t = int(input())
for j in range(t):
	n = int(input())
	a = []
	for i in range(n):
		a.append(1)
	if n == 1000:
		a[n - 1] = 1000
	print(*a)


for tt in range(int(input())):
	n = int(input())
	print(*[1] * n)


n = int(input())
l = list()
for i in range(n):
	l.append(int(input()))
for j in l:
	str = '1' * j
	for k in str:
		print(int(k), '', end='')
	print()


n = int(input())
li = []
for i in range(n):
	a = int(input())
	li.append(a)
for item in li:
	answer = []
	while item - len(answer) > 0:
		answer.append(1)
	print(*answer)


t = int(input())
for t in range(t):
	n = int(input())
	array = ['1' for i in range(n)]
	output = ' '.join(array)
	print(output)


from sys import stdin, stdout
from itertools import combinations
from collections import defaultdict, Counter
import math

def listIn():
	return list(map(int, stdin.readline().strip().split()))

def stringListIn():
	return [x for x in stdin.readline().split()]

def intIn():
	return int(stdin.readline())

def stringIn():
	return stdin.readline().strip()
t = intIn()
while t > 0:
	t -= 1
	n = intIn()
	ans = [1] * (n - 1) + [10]
	print(*ans)


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import bisect as bi
import heapq

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def main():
	try:
		n = I()
		l = ['1'] * n
		print(*l)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


import sys
from collections import defaultdict as dd
from collections import deque
from fractions import Fraction as f
from copy import *
from bisect import *
from heapq import *
from math import *
from itertools import permutations

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def li():
	return [int(x) for x in input().split()]

def fli():
	return [float(x) for x in input().split()]

def gi():
	return [x for x in input().split()]

def fi():
	return int(input())

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)

def bo(i):
	return ord(i) - ord('a')
t = fi()
while t > 0:
	t -= 1
	n = fi()
	for i in range(n):
		print(1, end=' ')
	print()


def f(n):
	a = ''
	for i in range(n - 1):
		a = a + str(2 * i + 1) + ' '
	a = a + str(2 * n - 1)
	return a
for i in range(int(input())):
	n = int(input())
	if n < 500:
		print(f(n))
	else:
		print(f(500) + ' ' + f(n - 500))


for _ in range(int(input())):
	n = int(input())
	ans = [44] * n
	print(*ans)


for j in range(int(input())):
	n = int(input())
	for h in range(n):
		print('1', end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = []
	odd = 1
	for i in range(n):
		if i % 2 == 0:
			a.append(i + 1)
		else:
			a.append(i)
	print(*a)


for _ in range(int(input())):
	n = int(input())
	c = 1
	l = []
	for i in range(n):
		if c < 1000:
			l.append(c)
			c += 2
		else:
			c = 1
			l.append(c)
	for i in l:
		print(i, end=' ')
	print()


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	N = int(input())
	ans = [1] * N
	print(*ans)


import math
t = int(input())
for i in range(t):
	print(' '.join([str(1) for x in range(int(input()))]))


y = int(input())
ans = []
for i in range(y):
	n = int(input())
	for j in range(n):
		print('1', end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	q = [1] * n
	print(*q)


for _ in range(int(input())):
	n = int(input())
	a = [0] * n
	if n == 1000:
		for i in range(n):
			a[i] = 999
	else:
		for i in range(n):
			a[i] = 1
	print(*a)


get_int = lambda : int(input())
get_mul_int = lambda : map(int, input().rstrip().split())
get_list = lambda : list(map(int, input().rstrip().split()))
TEST_CASES = True

def main():
	n = get_int()
	a = [2] * n
	print(*a)
if not TEST_CASES:
	main()
else:
	[main() for _ in range(int(input()))]


t = int(input())

def fun(n):
	a = []
	for i in range(n):
		a.append(1)
	print(*a, sep=' ')
while t:
	t -= 1
	n = int(input())
	fun(n)


import sys
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br

def solve():
	(n,) = I()
	print(*[1000] * n)
(t,) = I()
while t:
	t -= 1
	solve()


t = int(input())
while t > 0:
	n = int(input())
	a = []
	j = 1
	if n <= 500:
		for i in range(n):
			a.append(j)
			j = j + 2
	else:
		for i in range(500):
			a.append(j)
			j = j + 2
		j = 1
		for i in range(n - 500):
			a.append(j)
			j = j + 2
	print(' '.join(map(str, a)))
	t = t - 1


from sys import stdin, exit
input = stdin.readline

def i():
	return input()

def ii():
	return int(input())

def iis():
	return map(int, input().split())

def liis():
	return list(map(int, input().split()))

def print_array(a):
	print(' '.join(map(str, a)))
t = ii()
for _ in range(t):
	n = ii()
	for i in range(n):
		print(1, end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append(1)
	print(*l)


t = int(input())
c = []
for i in range(t):
	n = int(input())
	v = ''
	for k in range(n):
		v += str(1)
		v += ' '
	c.append(v)
for k in c:
	print(k)


import math
from sys import stdin
from collections import Counter, defaultdict, deque
input = stdin.readline
mod = pow(10, 9) + 7

def solve():
	n = int(input())
	l1 = [1] * n
	print(*l1)
for _ in range(int(input())):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	ls = [1] * n
	print(*ls)


(t, *n) = map(int, open(0).read().split())
for x in n:
	temp = 1
	ans = []
	for i in range(x):
		ans.append(temp)
		if i % 2 == 1:
			temp += 2
	print(*ans)


import random
testcase = int(input())
for i in range(testcase):
	li = []
	for j in range(int(input())):
		li.append(1)
	print(*li, sep=' ')


import random
numberOfTestCase = int(input())
toBuilt = []
for i in range(numberOfTestCase):
	toBuilt.append(int(input()))

def compMatrix(longueur):
	comp = []
	for i in range(longueur):
		comp.append(1)
	return comp

def impMat(mat):
	for i in range(len(mat)):
		print(*mat[i])
impMat(list(map(compMatrix, toBuilt)))


for _ in range(int(input())):
	for _ in range(int(input())):
		print('1 ', end='')
	print()


def solve():
	n = int(input())
	a = [1] * n
	for i in range(n):
		if i % 3 == 2:
			a[i] = 3
	print(*a, sep=' ')
test = int(input())
for _ in range(test):
	solve()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
for _ in range(int(ri())):
	n = int(ri())
	for i in range(0, n // 2):
		print(*[1, 3], end=' ')
	if n % 2 == 1:
		print(1)
	else:
		print()


import sys
input = sys.stdin.readline
INF = float('inf')
tc = int(input())
for _ in range(tc):
	n = int(input())
	for i in range(1, n + 1):
		print(1, end=' ')
	print()


def driver(x):
	for i in range(x - 1):
		print(x, end=' ')
	print(x)

def main():
	for i in range(int(input())):
		x = int(input())
		driver(x)
main()
2


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	rr = []
	for _ in range(t):
		n = I()
		rr.append(JA([1] * n, ' '))
	return JA(rr, '\n')
print(main())


def rep(n):
	for i in range(n):
		print(44, end=' ')
	print()
testcase = int(input())
for i in range(testcase):
	n = int(input())
	rep(n)


n = int(input())
for t_c in range(n):
	num = int(input())
	lis = [9] * num
	print(*lis)


A = [i + (i + 1) % 2 for i in range(1000)]
for _ in range(int(input())):
	print(*A[:int(input())])


for i in range(int(input())):
	n = int(input())
	lst = list()
	for i in range(n):
		lst.append(1)
	print(*lst, sep=' ')


z = int(input())
for h in range(z):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	s = int(input())
	a = ' '.join(['1' for x in range(s)])
	print(a)


tests = int(input())
for test in range(tests):
	n = int(input())
	print(*[1] * n)


__MULTITEST = True

def solve():
	n = int(input())
	a = [1] * n
	print(*a)
t = int(input()) if __MULTITEST else 1
for tt in range(t):
	solve()


n = int(input())
alist = []
for i in range(n):
	m = int(input())
	a = ' '.join(['1'] * m)
	alist.append(a)
for i in alist:
	print(i)


n_sets = int(input())
for i in range(n_sets):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


t = int(input())
while t:
	n = int(input())
	for x in range(n):
		print('1', end=' ')
	print()
	t -= 1


T = int(input())
for _ in range(T):
	N = int(input())
	first = 1
	second = first
	ans = []
	ans.append(first)
	for i in range(1, N):
		if first == second and first == 1:
			temp = first % 1000
			first = second % 1000
			ans.append(first)
			second = (first + second + 1) % 1000
			continue
		elif first == second:
			temp = first % 1000
			first = second % 1000
			ans.append(first)
			second = (temp + second + 1) % 1000
		else:
			first = second % 1000
			ans.append(first)
	print(*ans)


t = int(input())
cases = []
for i in range(t):
	cases.append(int(input()))
for n in cases:
	arr = []
	if n == 2:
		print('1 6')
	else:
		for i in range(n - 1):
			arr.append('1')
		arr.append(str(n))
		print(' '.join(arr))


for i in range(int(input())):
	n = int(input())
	cnt = 100
	res = []
	for i in range(n):
		res.append(cnt)
	print(*res)


cases = int(input())
for i in range(cases):
	number = int(input())
	print('1 ' * number)


for t in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		a.append(2 * (i // 2) + 1)
	print(*a)


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	(i, c) = (1, 0)
	while c < n:
		l.append(i)
		c += 1
		i += 2
		if i > 1000:
			i = 1
	print(*l)


for i in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(1)
	print(*arr)


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
for _ in range(int(input())):
	N = int(input())
	for i in range(N):
		print('3', end=' ')
	print()


t = int(input())
for x in range(t):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


for i in range(int(input())):
	print(' '.join(['1' for i in range(int(input()))]))


for _ in range(int(input())):
	n = int(input())
	ls = []
	k = 1
	for _ in range(n // 2):
		if k == 1:
			ls.append(2)
			k = 0
		if k == 0:
			ls.append(3)
			k = 1
	if n % 2 != 0:
		ls.append(2)
	print(*ls)


tot = int(input().strip())
while tot > 0:
	n = int(input().strip())
	print(' '.join(['1' for _ in range(0, n)]))
	tot -= 1


from sys import stdin, stdout, setrecursionlimit
from math import gcd, sqrt, floor, ceil
setrecursionlimit(10000000)
input = stdin.readline

def list_inp(x):
	return list(map(x, input().split()))

def map_inp(x):
	return map(x, input().split())

def lcm(a, b):
	return a * b / gcd(a, b)
t = int(input())
for _ in range(t):
	n = int(input())
	print('5 ' * n)


for i in range(int(input())):
	arr = [1] * int(input())
	print(' '.join([str(elem) for elem in arr]))


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
for _ in range(inp()):
	n = inp()
	x = [1] * n
	print(*x)


t = int(input())
for i in range(t):
	n = int(input())
	b = [1] * n
	print(*b)


for i in range(int(input())):
	n = int(input())
	k = 0
	for j in range(n):
		print(999, end=' ')
	print(' ')


elem = int(input())
for i in range(elem):
	num = int(input())
	ar = []
	count = 1
	for j in range(num):
		ar.append(1)
	print(*ar)


import math
t = int(input())
for w in range(t):
	n = int(input())
	l = [1] * n
	print(*l)


t = int(input())
ans = [[]] * t
for i in range(t):
	n = int(input())
	a = [1] * n
	ans[i] = a
for i in range(t):
	print(' '.join(list(map(str, ans[i]))))


t = int(input())
for i in range(t):
	n = int(input())
	li = [1, 5, 3]
	ans = []
	point = 0
	for j in range(n):
		if point == 3:
			point = 0
		ans.append(li[point])
		point += 1
	for item in ans:
		print(item, end=' ')
	print()


import sys
input = sys.stdin.readline
T = int(input())
for t in range(T):
	N = int(input())
	print(' '.join(map(str, [1 for i in range(N)])))


t = int(input())
for i in range(t):
	n = int(input())
	count = 0
	if n <= 500:
		for j in range(1, 1001, 2):
			if count < n:
				print(j, end=' ')
				count += 1
	else:
		while count < n:
			print(1, end=' ')
			count += 1
	print('')


t = int(input())
for i in range(t):
	n = int(input())
	arr = ['1'] * n
	s = ' '.join(arr)
	print(s)


import io
import os
from collections import Counter, defaultdict, deque

def solve(N):
	return ' '.join(map(str, [999] * N))
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N,) = [int(x) for x in input().split()]
	ans = solve(N)
	print(ans)


import os, io
from sys import stdout
import collections
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys

def primes(n):
	sieve = [True] * n
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i]:
			sieve[i * i::2 * i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [i for i in range(3, n, 2) if sieve[i]]

def binomial_coefficient(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def powerOfK(k, max):
	if k == 1:
		return [1]
	if k == -1:
		return [-1, 1]
	result = []
	n = 1
	while n <= max:
		result.append(n)
		n *= k
	return result

def divisors(n):
	i = 1
	result = []
	while i * i <= n:
		if n % i == 0:
			if n / i == i:
				result.append(i)
			else:
				result.append(i)
				result.append(n / i)
		i += 1
	return result

def distance(xa, ya, xb, yb):
	return ((ya - yb) ** 2 + (xa - xb) ** 2) ** 0.5

def digitsSum(n):
	if n == 0:
		return 0
	r = 0
	while n > 0:
		r += n % 10
		n //= 10
	return r

def isValid(i, j, n, m):
	return i >= 0 and i < n and (j >= 0) and (j < m)

def print_grid(grid):
	for line in grid:
		print(' '.join(map(str, line)))

def kadane(a, size):
	max_so_far = 0
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def prefixSum(arr):
	for i in range(1, len(arr)):
		arr[i] = arr[i] + arr[i - 1]
	return arr

def ceil(n, d):
	if n % d == 0:
		return n // d
	else:
		return n // d + 1

def _abs(a, b):
	return int(abs(a - b))

def evenodd(l):
	even = [e for e in l if e & 1 == 0]
	odd = [e for e in l if e & 1]
	return (even, odd)
t = int(input())
for _ in range(t):
	n = int(input())
	r = [1] * n
	print(' '.join(list(map(str, r))))


t = int(input())
for _ in range(t):
	n = int(input())
	print(' '.join(list(map(str, [1] * n))))


test_case = int(input())
for i in range(test_case):
	n = int(input())
	arr = [2] * n
	s = ' '.join(map(str, arr))
	print(s)


def main():
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()
t = int(input())
for i in range(t):
	main()


for _ in range(int(input())):
	n = int(input())
	ans = [10 for i in range(n)]
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	x = 1
	y = 1
	for i in range(n):
		if i % 2 == 0:
			print('2', end=' ')
		else:
			print('5', end=' ')
	print()


t = int(input())
for u in range(t):
	n = int(input())
	j = 1
	for i in range(n):
		print(j, end=' ')
		j += 2
		if j > 999:
			j = 1
	print('\n', end='')


for x in range(int(input())):
	print(*[x if x < 1000 else x - 1000 for x in range(1, int(input()) * 2, 2)])


def solve(n):
	return [1] * n
t = int(input())
cnt = 0
while cnt < t:
	cnt += 1
	n = int(input())
	res = solve(n)
	print(' '.join((str(i) for i in res)))


t = int(input())
while t > 0:
	n = int(input())
	arr = [1] * n
	print(*arr, sep=' ')
	t -= 1


for x in range(int(input())):
	for y in range(int(input())):
		print('1', end=' ')
	print('')


def runCase():
	arraySize = int(input())
	print((arraySize * '1 ')[:-1])
cases = int(input())
for i in range(cases):
	runCase()


t = int(input())
for i in range(t):
	n = int(input())
	for j in range(n):
		print(999, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	res = [1 for i in range(n)]
	print(*res)


def main():
	t = int(input())
	ans = []
	for i in range(t):
		n = int(input())
		arr = [1] * n
		ans.append(arr)
	for i in ans:
		for j in i:
			print(j, end=' ')
		print()
main()


for test in range(int(input())):
	n = int(input())
	arr = []
	for i in range(1, n + 1):
		if i % 2 == 0:
			arr.append(i - 1)
		else:
			arr.append(i)
	print(*arr)


n = int(input())
for i in range(n):
	a = int(input())
	summ = 1
	for i in range(1, a + 1):
		if i % 3 == 0:
			if i == a:
				print(summ * 2 + 1)
			else:
				print(summ * 2 + 1, end=' ')
		elif i == a:
			print(summ)
		else:
			print(summ, end=' ')


def full(n):
	return [1] * n
t = int(input())
for _ in range(t):
	n = int(input())
	print(*full(n))


for t in range(int(input())):
	print(*[(2 * i + 1) % 1000 for i in range(int(input()))])


cases = eval(input())
for _ in range(cases):
	nums = eval(input())
	arr = ''
	for _ in range(nums):
		arr += '1 '
	print(arr.strip())


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
for _ in range(INT()):
	N = INT()
	used = set([1, 3])
	ans = [1, 1, 3, 3]
	for x in range(4, N + 1):
		ok = True
		for a in used:
			if x - a in used:
				ok = False
				break
		if ok:
			ans.append(x)
			ans.append(x)
			used.add(x)
		if len(ans) >= N:
			break
	while len(ans) > N:
		ans.pop()
	print(*ans)


for x in range(int(input())):
	l = int(input())
	s = '{} '.format(1)
	print(s * l)


for _ in range(int(input())):
	n = int(input())
	s = ''
	for i in range(n):
		s = s + '1' + ' '
	print(s)


from math import *
from collections import *
from bisect import *
import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	print(*[1] * n)


t = int(input())
for i in range(t):
	x = int(input())
	print('1 ' * x)


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
for _ in range(iinput()):
	n = iinput()
	ans = [1] * n
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	flag = 0
	a = []
	for i in range(0, n // 2):
		if flag == 0:
			a.append(1000)
			a.append(1000)
			flag = 1
		else:
			a.append(222)
			a.append(222)
			flag = 0
	if n & 1:
		a.append(1)
	print(*a)


def solve():
	n = int(input())
	ans = [1 for i in range(n)]
	print(*ans)
t = int(input())
for i in range(t):
	solve()


temp = 1
for _ in range(int(input())):
	n = int(input())
	result = [temp for _ in range(n)]
	print(*result)
	temp += 1


t = int(input())
for _ in range(t):
	n = int(input())
	print(*('2 ' * n).split())


t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(n):
		print(4, end=' ')
	print('')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	l = [2] * n
	print(*l)


tests = int(input())
for t in range(tests):
	n = int(input())
	res = ['1' for i in range(n)]
	print(' '.join(res))


n_tests = int(input())
for i in range(n_tests):
	n = int(input())
	ans = []
	for i in range(n - 1):
		ans.append(1)
	ans.append(1000)
	for i in range(n):
		print(ans[i], end=' ')
	print()


from sys import stdin, stdout
import heapq as hq
from collections import defaultdict
t = int(input())
for tc in range(t):
	n = int(stdin.readline())
	for nc in range(n):
		stdout.write('999' + ' ')
	stdout.write('\n')


import sys
input = sys.stdin.readline

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
for i in range(int(input())):
	n = int(input())
	arr = ['1' for _ in range(n)]
	print(' '.join(arr))


from sys import stdin, setrecursionlimit, stdout
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin
from heapq import heapify, heappop, heappush, heapreplace, heappushpop

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline().rstrip()

def lsi():
	return list(si())
res = ['YES', 'NO']
test_case = ii()
while test_case:
	test_case -= 1
	n = ii()
	a = [1] * n
	print(*a)


from sys import stdin, stdout
import bisect

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
			n = n - 1
		else:
			a = a * a
			n = n >> 1
	return r

def solve():
	n = inp()
	print('2', end=' ')
	for i in range(n - 1):
		print('1000', end=' ')
	print()
for _ in range(inp()):
	solve()


cnt = int(input())
for _ in range(cnt):
	x = int(input())
	arr = []
	for i in range(0, x):
		arr.append(1)
	print(*arr)


T = int(input(''))
for i in range(T):
	num = int(input(''))
	for j in range(num):
		print(1, end=' ')
	print('')


t = int(input())
for k in range(t):
	n = int(input())
	a = [1 for i in range(n)]
	print(*a)


t = int(input())
for q in range(t):
	n = int(input())
	li = ['1' for i in range(n)]
	print(' '.join(li))


x = int(input())
for i in range(x):
	n = int(input())
	ar = [2] * n
	print(*ar)


a = int(input())
for _ in range(a):
	b = int(input())
	t = []
	for i in range(b):
		t.append(1)
	print(*t)


import math

def dtod(a):
	s = ''
	while a != 0:
		s += str(a % 2)
		a = int(a / 2)
	return s[::-1]
n = int(input())
for i in range(n):
	a = int(input())
	print('1 ' * a)


for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		a = [2 * i + 1 for i in range(n // 2)]
		b = [2 * i + 1 for i in range(n // 2)]
		c = a + b
		print(*c)
	else:
		a = [2 * i + 1 for i in range(n // 2)]
		b = [2 * i + 1 for i in range(n // 2 + 1)]
		c = a + b
		print(*c)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		n = list(map(int, input().split()))
		ans = []
		if n[0] % 2 == 0:
			ans.extend([1] * (n[0] // 2))
			ans.extend([3] * (n[0] // 2))
		else:
			ans.extend([1] * (n[0] // 2))
			ans.extend([3] * (n[0] // 2))
			ans.append(5)
		print(' '.join([str(x) for x in ans]))
main()


import sys
t = int(input())
for i in range(t):
	n = int(input())
	print(*[1] * n)


t = int(input())
for i in range(t):
	x = int(input())
	k = []
	for i in range(x):
		k.append('1')
	print(' '.join(k))


t = int(input())
for tc in range(t):
	n = int(input())
	for x in range(n):
		print('1', end=' ')
	print('')


from sys import stdin, stdout
int_in = lambda : int(stdin.readline())
arr_in = lambda : [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda : stdin.readline().strip()
out = lambda o: stdout.write('{}\n'.format(o))
arr_out = lambda o: out(' '.join(map(str, o)))
bool_out = lambda o: out('YES' if o else 'NO')
tests = lambda : range(1, int_in() + 1)
case_out = lambda i, o: out('Case #{}: {}'.format(i, o))

def solve(n):
	return [1] * n
for _ in tests():
	n = int_in()
	arr_out(solve(n))


from fractions import Fraction
import bisect
import os
import io
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
from queue import Queue

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
t = 1
t = iinput()
for _ in range(t):
	print('1 ' * iinput())


for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(1000, end=' ')
	print()


testcases = int(input())
seq = [i for i in range(1, 1001)]
for _ in range(testcases):
	n = int(input())
	r = ['1' for i in range(n)]
	print(' '.join(r))


from collections import Counter, defaultdict, deque
import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	ans = []
	for i in range(1, n + 1):
		ans.append(i + i % 2 - 1)
	print(*ans)
tt = int(input())
for test in range(tt):
	solve()


for t in range(int(input())):
	n = int(input())
	ans = [5] * n
	print(*ans)


T = int(input())
while T > 0:
	n = int(input())
	x = [1] * n
	print(*x)
	T -= 1


import sys
input = lambda : sys.stdin.readline().strip()

def solve():
	n = int(input())
	c = 1
	for _ in range(n // 2):
		print(c, c, end=' ')
		c += 2
	if n & 1:
		print(c)
	else:
		print()
t = int(input())
while t:
	t -= 1
	solve()


T = int(input())
for z in range(T):
	N = int(input())
	for i in range(N - 1):
		print(1, end=' ')
	print(1)


import io
import os
from math import log, ceil
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def solve():
	n = int(input())
	a = [3, 5, 7, 11, 13, 17, 23, 29, 31]
	b = n // 9
	c = []
	for i in range(b * 9):
		c.append(a[i % 9])
	c = c + a[:n % 9]
	print(*c)

def main():
	for t in range(int(input())):
		solve()
main()


t = int(input())
i = 0
while i < t:
	n = int(input())
	r = []
	for j in range(n):
		r.append(1)
	for j in range(n - 1):
		print(r[j], end=' ')
	print(1)
	i += 1


n = int(input())
for i in range(n):
	a = int(input())
	result = ['1' for i in range(a)]
	print(' '.join(result))


n = int(input())
for _ in range(n):
	m = int(input())
	lst = [9] * m
	print(*lst)


from __future__ import division, print_function
from fractions import Fraction
import sys, bisect, heapq, copyreg, copy, statistics, os
from math import *
from collections import Counter, defaultdict, deque, OrderedDict
from itertools import combinations, permutations, accumulate
from bisect import bisect_left, bisect_right, bisect
from statistics import mode
from functools import reduce
from io import BytesIO, IOBase
from decimal import *
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def graph(vertex):
	return [[] for i in range(vertex + 1)]

def lcm(a, b):
	return a * b // gcd(a, b)

def most_frequent(List):
	return Counter(List).most_common(1)[0][0]

def most_common(List):
	return mode(List)

def chinese_remainder(a, p):
	prod = reduce(op.mul, p, 1)
	x = [prod // pi for pi in p]
	return sum((a[i] * pow(x[i], p[i] - 2, p[i]) * x[i] for i in range(len(a)))) % prod

def createMatrix(rowCount, colCount, dataList):
	mat = []
	for i in range(rowCount):
		rowList = []
		for j in range(colCount):
			if dataList[j] not in mat:
				rowList.append(dataList[j])
		mat.append(rowList)
	return mat

def readTree():
	v = int(inp())
	adj = [set() for i in range(v + 1)]
	for i in range(v - 1):
		(u1, u2) = In()
		adj[u1].add(u2)
		adj[u2].add(u1)
	return (adj, v)

def sieve():
	li = [True] * 1000001
	(li[0], li[1]) = (False, False)
	prime = []
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	for i in range(1000001):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count

def digitsSum(n):
	if n == 0:
		return 0
	r = 0
	while n > 0:
		r += n % 10
		n //= 10
	return r

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return len(set(factors))

def prefixSum(arr):
	for i in range(1, len(arr)):
		arr[i] = arr[i] + arr[i - 1]
	return arr

def binomial_coefficient(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def powerOfK(k, max):
	if k == 1:
		return [1]
	if k == -1:
		return [-1, 1]
	result = []
	n = 1
	while n <= max:
		result.append(n)
		n *= k
	return result

def kadane(a, size):
	max_so_far = 0
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def divisors(n):
	result = []
	for i in range(1, ceil(sqrt(n)) + 1):
		if n % i == 0:
			if n / i == i:
				result.append(i)
			else:
				result.append(i)
				result.append(n / i)
	return result

def sumyilln(n):
	return n * (n + 1) // 2

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, ceil(sqrt(n)) + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def isPowerOf2(n):
	while n % 2 == 0:
		n //= 2
	return True if n == 1 else False

def power2(n):
	k = 0
	while n % 2 == 0:
		k += 1
		n //= 2
	return k

def sqsum(n):
	return n * (n + 1) * (2 * n + 1) // 6

def cusum(n):
	return sumn(n) ** 2

def pa(a):
	for i in range(len(a)):
		print(a[i], end=' ')
	print()

def pm(a, rown, coln):
	for i in range(rown):
		for j in range(coln):
			print(a[i][j], end=' ')
		print()

def pmasstring(a, rown, coln):
	for i in range(rown):
		for j in range(coln):
			print(a[i][j], end='')
		print()

def isPerfectSquare(n):
	return pow(floor(sqrt(n)), 2) == n

def nC2(n, m):
	return n * (n - 1) // 2 % m

def modInverse(n, p):
	return pow(n, p - 2, p)

def ncrmodp(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def reverse(string):
	return ''.join(reversed(string))

def listtostr(s):
	return ' '.join([str(elem) for elem in s])

def binarySearch(arr, l, r, x):
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def isPalindrome(s):
	return s == s[::-1]

def gt(x, h, c, t):
	return (x * h + (x - 1) * c) / (2 * x - 1)

def CountFrequency(my_list):
	freq = {}
	for item in my_list:
		freq[item] = freq[item] + 1 if item in freq else 1
	return freq

def CountFrequencyasPair(my_list1, my_list2, freq):
	for item in my_list1:
		freq[item][0] = freq[item][0] + 1 if item in freq else 1
	for item in my_list2:
		freq[item][1] = freq[item][1] + 1 if item in freq else 1
	return freq

def binarySearchCount(arr, n, key):
	left = 0
	right = n
	mid = 0
	while left < right:
		mid = (right + left) // 2
		if arr[mid] == key:
			while mid + 1 < n and arr[mid + 1] == key:
				mid += 1
			break
		elif arr[mid] > key:
			right = mid
		else:
			left = mid + 1
	while mid > -1 and arr[mid] > key:
		mid -= 1
	return mid

def primes(n):
	(sieve, l) = ([True] * (n + 1), [])
	for p in range(2, n + 1):
		if sieve[p]:
			l.append(p)
			for i in range(p, n + 1, p):
				sieve[i] = False
	return l

def Next_Greater_Element_for_all_in_array(arr):
	(s, n, reta, retb) = (list(), len(arr), [], [])
	arr1 = [list([0, i]) for i in range(n)]
	for i in range(n - 1, -1, -1):
		while len(s) > 0 and s[-1][0] <= arr[i]:
			s.pop()
		if len(s) == 0:
			arr1[i][0] = -1
		else:
			arr1[i][0] = s[-1]
		s.append(list([arr[i], i]))
	for i in range(n):
		reta.append(list([arr[i], i]))
		retb.append(arr1[i][0])
	return (reta, retb)

class LRUCache:

	def __init__(self, capacity: int):
		self.cache = OrderedDict()
		self.capacity = capacity

	def get(self, key: int) -> int:
		if key not in self.cache:
			return -1
		else:
			self.cache.move_to_end(key)
			return self.cache[key]

	def put(self, key: int, value: int) -> None:
		self.cache[key] = value
		self.cache.move_to_end(key)
		if len(self.cache) > self.capacity:
			self.cache.popitem(last=False)
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def I():
	return inp()

def II():
	return int(inp())

def FI():
	return float(inp())

def SI():
	return list(str(inp()))

def MI():
	return map(int, inp().split())

def LI():
	return list(MI())

def MF():
	return map(float, inp().split())

def LF():
	return list(MF())
MOD = 10 ** 9 + 7
mod = 998244353
for _ in range(II()):
	pa([1] * II())


import math
import random
from collections import *
mod = 1000000007
r1 = lambda : int(input())
rm = lambda : map(int, input().split())
rms = lambda : map(str, input().split())
rls = lambda : list(rm())

def def_value():
	return 'nan'

def solve():
	test = r1()
	while test:
		test -= 1
		n = r1()
		ls = [1] * n
		print(*ls)
solve()


from math import ceil
for ttt in range(int(input())):
	n = int(input())
	res = []
	for i in range(1, n + 1, 2):
		res.extend([i, i])
	if n % 2:
		res.pop()
	print(*res)


for x in range(int(input())):
	n = int(input())
	s = int(n / 2)
	t = n - s
	b = []
	i = 0
	while i < s:
		b.append(999)
		i += 1
	i = 0
	while i < t:
		b.append(1)
		i += 1
	for x in b:
		print(x, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(3, end=' ')
	print()


import sys, itertools
tc = int(sys.stdin.readline())
for _ in range(tc):
	n = int(sys.stdin.readline())
	ans = [1] * n
	print(' '.join(map(str, ans)))


z = int(input())
for _ in range(z):
	n = int(input())
	r = [1] * n
	print(*r)


import sys
import random
from sys import stdin, stdout

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
n = int(input())
a = [0] * int(n)
for i in range(0, n):
	a[i] = int(input())
for i in range(0, n):
	s = 1
	for k in range(a[i]):
		stdout.write(str(str(s) + ' '))
	print()


from sys import stdin
input = lambda : stdin.readline().rstrip('\r\n')
from collections import deque as que
from collections import defaultdict as vector
inin = lambda : int(input())
inar = lambda : list(map(int, input().split()))
Testcase = inin()
for _ in range(Testcase):
	n = inin()
	print('7 ' * n)


for _ in range(int(input())):
	n = int(input())
	cnt = 999
	for i in range(n):
		print(cnt, end=' ')
	print()


import sys, math
import io, os
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
mod = int(1000000000.0) + 7
for i in range(int(data())):
	n = int(data())
	outl([1] * n)


for _ in range(int(input())):
	n = int(input())
	ans = []
	if n % 2 == 0:
		for i in range(0, n // 2):
			ans.append(2 * i + 1)
			ans.append(2 * i + 1)
	else:
		for i in range(0, n // 2):
			ans.append(2 * i + 1)
			ans.append(2 * i + 1)
		if ans:
			ans.append(ans[-1] + 2)
		else:
			ans.append(1)
	print(*ans)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def outa(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	answer = [1 for i in range(n)]
	outa(*answer)


for i in range(int(input())):
	n = int(input())
	arr = [2] * n
	print(*arr)


from sys import stdin, stdout
for i in range(int(stdin.readline())):
	print(*[1 for i in range(int(stdin.readline()))])


for test in range(int(input())):
	n = int(input())
	a = [1 for i in range(n)]
	for i in a:
		print(i, end=' ')
	print()


test = int(input())
for i in range(test):
	ip = int(input())
	lst = [1] * ip
	for j in range(1, ip + 1):
		if j == ip:
			break
		if j == ip - 1:
			break
		if lst[j - 1] <= 1 and lst[j + 1 <= ip]:
			if lst[j - 1] + lst[j] == lst[j + 1]:
				lst[j] = lst[j] * ip
			else:
				pass
	print(*lst)


t = int(input())
for i in range(t):
	n = int(input())
	A = [1] * n
	print(*A)


def completion(n):
	l = [n for i in range(n)]
	return l
t = int(input())
for _ in range(t):
	n = int(input())
	result = completion(n)
	print(*result, sep=' ')


a = int(input(''))
for i in range(0, a):
	i = int(input(''))
	o = []
	n = ''
	for b in range(0, i):
		i = 1
		o.append(i)
	for f in o:
		n += str(f) + ' '
	print(n)


import math
import sys
from sys import stdin
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	arr = [1] * n
	print(*arr)


t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(n):
		if i % 2 == 0:
			print('2', end=' ')
		else:
			print('5', end=' ')
	print()


n = int(input())
a = ''
for i in range(n):
	k = int(input())
	for j in range(k):
		a += '2'
	print(' '.join(a))
	a = ''


for _ in range(int(input())):
	n = int(input())
	listi = list()
	flag = 0
	if n % 2 == 1:
		n = n + 1
		flag = 1
	a = 1
	for i in range(n // 2):
		listi.append(a)
		a += 2
	listi += reversed(listi)
	if flag == 1:
		listi.pop()
	print(*listi)


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		N = int(input())
		ans = [1] * N
		print(*ans)
main()


import sys
input = sys.stdin.buffer.readline

def solution():
	for _ in range(int(input())):
		n = int(input())
		x = 999
		l = []
		while n > 0:
			l.append(x)
			n -= 1
		print(*l)
solution()


for _ in range(int(input())):
	n = int(input())
	print('50 ' * n)


t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	result = [1 for i in range(n)]
	for num in result:
		print(num, end=' ')
	print()


for i in [0] * int(input()):
	ans = ''
	a = int(input())
	for i in range(a):
		ans += f'1 '
	print(ans)


n = int(input())
for i in range(n):
	num = int(input())
	for j in range(num):
		print(1, end=' ')
	print()


T = int(input())
for _ in range(0, T):
	n = int(input())
	s = []
	c = 0
	for i in range(1, 1000, 2):
		if c < n:
			s.append(i)
			c += 1
		else:
			break
	for i in range(1, 1000, 2):
		if c < n:
			s.append(i)
			c += 1
		else:
			break
	print(*s)


for k in range(int(input())):
	x = int(input())
	print('1 ' * x)


for t in range(int(input())):
	n = int(input())
	a = [1 for v in range(n)]
	print(*a)


for _ in range(int(input())):
	n = int(input())
	arr = []
	q = 0
	for i in range(n):
		arr.append(2 * q + 1)
		q += 1
		if q == 200:
			q = 0
	print(*arr, sep=' ')


import sys
from math import floor as fl
cont = sys.stdin.readlines()
cont = [i.strip('\n') for i in cont]
num = int(cont.pop(0)[0])
for i in cont:
	n = int(i)
	ret = ''
	for j in range(n):
		ret += '1 '
	print(ret)


import math
from collections import deque
from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	x = int(input())
	print(*[1] * x)


import math
import sys
input = sys.stdin.readline
t = int(input())
for cs in range(t):
	n = int(input())
	print(' '.join(['1'] * n))


from sys import stdin, stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
tc = ii1()
for _ in range(tc):
	n = ii1()
	res = [1] * n
	print(*res)


import sys
from math import ceil, sqrt, sin, pi, tan
from collections import defaultdict
read = sys.stdin.buffer.readline
import heapq
mi = lambda : map(int, read().split())
li = lambda : list(mi())
cin = lambda : int(read())

def ispd(s):
	n = len(s)
	if s[:n // 2] == s[[n // 2 + 1, n // 2][n % 2 == 0]:][::-1]:
		return True
	return False
for _ in range(cin()):
	n = cin()
	for i in range(n):
		print(n, end=' ')
	print()


import math
import os
import random
import re
import sys
from collections import Counter

def solve():
	for _ in range(int(input())):
		n = int(input())
		l = [1] * n
		print(' '.join(map(str, l)))
solve()


for i in range(int(input())):
	n = int(input())
	zz = []
	for i in range(n):
		zz.append(7)
	print(*zz, sep=' ')


try:
	T = int(input())
	while T != 0:
		N = int(input())
		for i in range(N - 1):
			print(2, end=' ')
		print(2)
		T -= 1
except:
	pass


def solve(n):
	return ' '.join(list(map(str, [1] * n)))
t = int(input())
for i_t in range(t):
	n = int(input())
	print(solve(n))


test = int(input())
for i in range(test):
	n = int(input())
	arr = [1 for i in range(n)]
	print(*arr)


t = int(input())
for z in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(int(1))
	print(*arr)


t = int(input())
for i in range(t):
	n = int(input())
	d = [1] * n
	print(*d)


l = int(input())
for i in range(l):
	n = int(input())
	for i in range(n):
		print('1 ', end='')
	print()


for _ in range(int(input())):
	x = int(input())
	a = []
	for i in range(x):
		a.append(1)
	for i in a:
		print(i, end=' ')
	print()


test = int(input())
for i in range(test):
	n = int(input())
	start = 1
	for i in range(n):
		if start > 1000:
			print(999, end=' ')
		else:
			print(start, end=' ')
			start += 2
	print()


t = int(input())
output = []
for i in range(t):
	n = int(input())
	out = [10] * n
	output.append(out)
for i in range(t):
	print(' '.join((str(e) for e in output[i])))


t = int(input())
while t:
	t -= 1
	n = int(input())
	lst = [5] * n
	print(*lst)


T = int(input().rstrip())
for test in range(T):
	n = int(input().rstrip())
	ans = [1] * n
	print(*ans)


ll = lambda : list(map(int, input().split()))
st = lambda : input()
v = lambda : map(int, input().split())
ii = lambda : int(input())
from collections import *
from math import *
from datetime import datetime
for _ in range(ii()):
	l = [1] * ii()
	print(*l)


for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print('69', end=' ')
	print()


import sys
import collections

def input():
	return sys.stdin.readline().rstrip()

def split_input():
	return [int(i) for i in input().split()]
tests = int(input())
for _ in range(tests):
	n = int(input())
	ans = [1] * n
	print(*ans, sep=' ')


t = int(input())
for ti in range(t):
	n = int(input())
	print('1 ' * n)


t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(n // 2):
		print(500 + i, 500 + i, end=' ')
	if n % 2 != 0:
		print(500 + (n - 1) // 2, end=' ')
	print()


for k in range(int(input())):
	n = int(input())
	f = [n] * n
	print(*f)


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')
MOD = 1000000007

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactors(n):
	factors = []
	i = 2
	while i ** 2 <= n:
		while n % i == 0:
			factors.append(i)
			n //= i
		i += 1
	if n > 1:
		factors.append(n)
	return factors

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def main():
	n = int(input())
	arr = [1 for i in range(n)]
	print(*arr)
t = int(input())
for _ in range(t):
	main()


x = int(input())
for a in range(x):
	y = int(input())
	arr = [1 for i in range(y)]
	print(*arr)


def main():
	ts = int(input())
	for _ in range(ts):
		n = int(input())
		o = ['1'] * n
		print(' '.join(o))
main()


t = int(input())
for t in range(t):
	n = int(input())
	list1 = []
	for i in range(n):
		list1.append(1)
	for i in range(len(list1)):
		if i != n - 1:
			print(1, end=' ')
		else:
			print(1)


from sys import stdin

def iinput():
	return int(stdin.readline())

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
t = iinput()
while t:
	t -= 1
	n = iinput()
	print(*[1] * n)


import sys
infile = sys.stdin
next(infile)
for line in infile:
	n = int(line)
	a = [300] * n
	print(*a)


def driver():
	t = int(input())
	for i in range(t):
		solution()

def solution():
	n = int(input())
	l = [int(1) for i in range(n)]
	print(*l)
driver()


for s in range(int(input())):
	print('1 ' * int(input()))


import sys
import math
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
setrecursionlimit(2 ** 20)
M = 998244353
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	for i in range(n):
		print(1, end=' ')
	print('')


for i in range(int(input())):
	n = int(input())
	print(*list([1] * n))


import sys
input = sys.stdin.readline
t = int(input())
memoization = [1] * 1000
for _ in range(t):
	n = int(input())
	print(*memoization[:n])


(T,) = map(int, input().split())
for _ in range(T):
	(N,) = map(int, input().split())
	print(*[1] * N)


for test in range(int(input())):
	n = int(input())
	lt = [3] * n
	print(*lt)


cases = int(input())
answers = [] * 0
for problems in range(cases):
	n = int(input())
	ans = ''
	for i in range(n):
		if len(ans) == 0:
			ans = '1'
		else:
			ans += ' 1'
	answers.append(ans)
for answer in answers:
	print(answer)


t = int(input())
for hatt in range(t):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


def problem1():
	n = int(input())
	j = 1
	a = [1] * n
	print(*a)
cases = int(input())
for _ in range(cases):
	problem1()


cases = int(input())
for i in range(cases):
	n = int(input())
	arr = []
	for j in range(n):
		arr.append('1')
	print(' '.join(arr))


def li():
	return list(map(int, input().split()))

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())
for _ in range(ii()):
	n = ii()
	s = []
	for i in range(n):
		print('1', end=' ')
	print()


def comp(n):
	return [5] * n
tc = int(input())
for i in range(tc):
	n = int(input())
	print(*comp(n))


for _ in range(int(input())):
	a = int(input())
	sol = [str(1) for i in range(a)]
	print(' '.join(sol))


for i in range(int(input())):
	n = int(input())
	x = 5
	ans = []
	for i in range(n - 1):
		ans.append(1)
	ans.append(5)
	for i in ans:
		print(i, end=' ')
	print()


def read_list():
	return list(map(int, input().split(' ')))

def print_list(l):
	print(' '.join(map(str, l)))
N = int(input())
for _ in range(N):
	n = int(input())
	print_list([1] * n)


for i in range(int(input())):
	lt = [1, 3]
	n = int(input())
	if n >= 500:
		dt = list(range(1, 1000, 2))
		dt += dt[:n - 500]
		print(*dt)
	else:
		print(*list(range(1, 2 * n, 2)))


import sys
import os
import io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def solve():
	n = int(input())
	answer = ' '.join((str(1) for _ in range(n)))
	print(answer)
test_case = int(input())
for _ in range(test_case):
	solve()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	ans = [999] * n
	print(*ans)


import sys
input = sys.stdin.readline

def print(val):
	sys.stdout.write(str(val) + '\n')

def prog():
	for _ in range(int(input())):
		n = int(input())
		print('1 ' * n)
prog()


def calc(N):
	print(*[200 for i in range(N)])
t = int(input())
for i in range(t):
	n = int(input())
	calc(n)


import sys

class IoTool:
	DEBUG = 0

	def _reader_dbg():
		with open('./input.txt', 'r') as f:
			lines = f.readlines()
		return iter(lines)
	reader = _reader_dbg() if DEBUG else iter(sys.stdin.read().split('\n'))
input = lambda : next(IoTool.reader)

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(*[1] * n)
main()


import sys
ii = lambda : sys.stdin.readline().strip()
idata = lambda : [int(x) for x in ii().split()]

def solve():
	n = int(ii())
	print('1 ' * n)
	return
for t in range(int(ii())):
	solve()


import sys
import math
from sys import stdin, stdout
from collections import deque, defaultdict
from math import ceil, floor, inf, sqrt, factorial, gcd, log2
from copy import deepcopy
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = int(1000000000.0 + 7)
for t in range(ii1()):
	n = ii1()
	for i in range(n):
		print(1, end=' ')
	print()


T = int(input())
while T > 0:
	n = int(input())
	ans = ''
	for i in range(0, n):
		ans += '1' + ' '
	print(ans)
	T -= 1


T = int(input())
for i in range(T):
	n = int(input())
	print('1 ' * (n - 1) + '1')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
a = [i for i in range(1, 1001, 2)]
for _ in range(int(input()) if True else 1):
	n = int(input())
	c = 0
	b = []
	while n:
		b += [a[c]]
		n -= 1
		if not n:
			break
		else:
			b += [a[c]]
			n -= 1
		c += 1
	print(*b)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [1 for i in range(n)]
	print(' '.join([str(j) for j in arr]))


t = int(input())
for i in range(t):
	n = int(input())
	for i in range(n):
		if n <= 1000:
			print(1, end=' ')
	print()


import sys
for i in range(int(sys.stdin.readline())):
	N = int(sys.stdin.readline())
	checker = []
	for x in range(1, N + 1, 2):
		checker.append(x)
		if len(checker) == N:
			break
		checker.append(x)
	print(*checker)


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
for _ in range(ii()):
	n = ii()
	a = []
	for i in range(0, n):
		a.append(1)
	print(*a)


for x in range(int(input())):
	n = int(input())
	a = 10
	b = []
	for x in range(n):
		b.append(a)
	print(*b)


import sys
input = sys.stdin.readline
Q = int(input())
Query = [int(input()) for _ in range(Q)]
for N in Query:
	ans = [1] * N
	print(*ans)


import sys
input = iter(sys.stdin.read().splitlines()).__next__
sys.setrecursionlimit(10000)
TC = int(input())
for tc in range(TC):
	N = int(input())
	print(' '.join(['1' for x in range(N)]))


try:
	for i in range(int(input())):
		n = int(input())
		a = []
		for i in range(n):
			a.append(2)
		for i in range(n):
			print(a[i], end=' ')
		print()
except Exception:
	pass


read = lambda : map(int, input().split())
t = int(input())
res = ''
for i in range(t):
	n = int(input())
	res += ' '.join(map(str, [1] * n)) + '\n'
print(res)


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd
from collections import deque
from bisect import bisect_left, bisect_right
for _ in range(int(input())):
	n = int(input())
	s = set()
	x = 1
	l = []
	z = set()
	while n > 0:
		if n == 1:
			l.append(x)
			n -= 1
			break
		else:
			l.append(x)
			l.append(x)
			n -= 2
			s.add(2 * x)
			z.add(x)
		for i in z:
			s.add(i + x)
		for i in range(x + 1, 1001):
			if i not in s:
				x = i
				break
	print(*l)


for __ in range(int(input())):
	n = int(input())
	ar = [1] * n
	print(*ar)


from math import *

def r1(t):
	return t(input())

def r2(t):
	return [t(i) for i in input().split()]
for _ in range(r1(int)):
	n = r1(int)
	for i in range(n - 1):
		print(1, end=' ')
	print(1000)


import sys
import math
import collections
import heapq
import queue
import itertools
import functools
import operator
import time
readline = sys.stdin.readline
IPS = lambda : readline().rstrip()
IP = lambda : int(readline().rstrip())
MP = lambda : map(int, readline().split())
LS = lambda : list(map(int, readline().split()))

def solve():
	for _ in range(IP()):
		n = IP()
		for i in range(n):
			print(1, end=' ')
		print()
solve()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	string = ''
	for x in range(n):
		string += '1 '
	print(string[0:-1])


for x in range(int(input())):
	n = int(input())
	for x in range(n):
		print(1, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	if n <= 500:
		for i in range(n):
			l.append(2 * i + 1)
	else:
		for i in range(n):
			l.append(n)
	for i in l:
		print(i, end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(1)
	else:
		t = n - 1
		l = [t] * n
		print(*l)


def readn():
	return int(input())

def readlist():
	return list(map(int, input().split()))

def readnos():
	return map(int, input().split())

def power(n):
	ans = 0
	while n > 0:
		ans += n % 10
		n = n // 10
	return ans
for _ in range(readn()):
	n = readn()
	a = []
	for i in range(n):
		a.append(1)
	print(*a, sep=' ')


import math
for _ in range(int(input())):
	n = int(input())
	l = [1] * math.ceil(n / 2)
	l.extend([5] * math.floor(n / 2))
	print(*l, sep=' ')


a = int(input())
for i in range(0, a):
	n = int(input())
	arr = [2] * n
	print(' '.join(map(str, arr)))


from sys import stdin, exit, setrecursionlimit
from bisect import *
from collections import deque
setrecursionlimit(10000000)
from math import *
from collections import deque
input = stdin.readline
lmi = lambda : list(map(int, input().split()))
mi = lambda : map(int, input().split())
si = lambda : input().strip('\n')
ssi = lambda : input().strip('\n').split()
for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


import sys
import bisect
import math as mt
input = sys.stdin.readline
t = int(input())
mod = 10 ** 9 + 7
for _ in range(t):
	n = int(input())
	print(1, end=' ')
	for i in range(n - 1):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	toPrint = []
	for _ in range(n):
		toPrint.append('1')
	print(' '.join(toPrint))


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	arr = [1] * n
	print(*arr)


for i in range(int(input())):
	n = int(input())
	for i in range(n):
		if i % 2 == 0:
			print(str(1), end=' ')
		else:
			print(str(3), end=' ')
	print()


for i in range(int(input())):
	x = int(input())
	one = '1 '
	one *= x
	one = one[:-1]
	print(one)


def func(n):
	A = []
	i = 1
	while n > 0 and i < 1000:
		A.append(i)
		i += 2
		n -= 1
	i = 1
	while n > 0 and i < 1000:
		A.append(i)
		i += 2
		n -= 1
	return A
t = int(input())
for i in range(t):
	n = int(input())
	res = func(n)
	for i in res:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append(2)
	print(*l)


n = int(input())
arr = []
for i in range(n):
	arr.append(int(input()))
for j in range(len(arr)):
	for i in range(arr[j]):
		print(1, sep=' ', end='\n' if i == arr[j] - 1 and j != len(arr) - 1 else ' ')


import math

def dtb(n):
	return bin(n).replace('0b', '')

def btd(n):
	return int(n, 2)
t = int(input())
for k in range(t):
	n = int(input())
	for i in range(n):
		print(5, end=' ')
	print()


import sys
from collections import deque
import heapq
input = lambda : sys.stdin.readline().strip()
ipnut = input
pprint = lambda x: print(' '.join(map(lambda t: str(t + 1), x)))

def mex():
	used = set(a)
	for i in range(n + 1):
		if i not in used:
			return i
for _ in range(int(input())):
	n = int(input())
	print('1 ' * n)


for _ in range(int(input())):
	n = int(input())
	list1 = []
	if n == 1:
		print(1)
		continue
	if n % 2:
		for i in range(1, n, 2):
			list1.append(i)
		list1 = list1 * 2
		list1.append(i + 2)
	else:
		for i in range(1, n, 2):
			list1.append(i)
		list1 = list1 * 2
	print(*list1)


from sys import stdin, stdout
fi = stdin
fo = stdout
n_test = int(fi.readline())

def solve():
	n = int(fi.readline())
	a = ['1'] * n
	print(' '.join(a))
for i_test in range(n_test):
	solve()


def call():
	n = int(input())
	print('1 ' * n)
for _ in range(int(input())):
	call()


for i in [*open(0)][1:]:
	print('1 ' * int(i))


n = int(input())
i = 0
while i < n:
	x = int(input())
	j = 0
	num_list_1 = []
	while j < x:
		num_list_1.append('1')
		j += 1
	i += 1
	print(' '.join(num_list_1))


def series(n):
	(data, x) = ([1], 1)
	for _ in range(0, n - 1):
		x += 2
		if x > 1000:
			x = 1
		data.append(x)
	return data

def improved(n):
	return [1] * n
t = int(input())
for _ in range(t):
	n = int(input())
	for _ in range(n):
		print(1, end=' ')
	print()


for T in range(int(input())):
	n = int(input())
	arr = [1] * n
	print(*arr)


for u in range(int(input())):
	n = int(input())
	l = [1] * n
	print(*l)


input_length = int(input())
while input_length != 0:
	n = int(input())
	for i in range(1, n + 1):
		print(1, end=' ')
	if input_length != 1:
		print()
	input_length -= 1


t = int(input())
for i in range(t):
	n = int(input())
	dec = list('1' * n)
	print(*dec, sep=' ')


import sys
input = sys.stdin.readline
import heapq
import copy
import math
import decimal

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def insr2():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())

def pr_list(a):
	print(*a, sep=' ')

def main():
	tests = inp()
	mod = 1000000007
	limit = 10 ** 18
	ans = 0
	stack = []
	hashm = {}
	arr = []
	heapq.heapify(arr)
	for test in range(tests):
		n = inp()
		ans = []
		for i in range(n):
			ans.append(1)
		pr_list(ans)
main()


for _ in range(int(input())):
	n = int(input())
	arr = ['1'] * n
	s = ' '.join(arr)
	print(s)


from sys import stdin, stdout

def INPUT():
	return list((int(i) for i in stdin.readline().split()))

def inp():
	return stdin.readline()

def out(x):
	return stdout.write(x)
import math
for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


def main():
	(n,) = map(int, input().split(' '))
	print(*[1] * n)
for _ in range(int(input())):
	main()


from sys import stdin, stdout
from collections import deque
import math
t = int(input())
for i in range(t):
	n = int(input())
	a = [1] * n
	print(*a)


from collections import deque
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from bisect import bisect_left as bl
from math import log2, ceil
from heapq import heappush, heappop
from itertools import permutations

def main():
	for t in range(int(input())):
		n = int(input())
		print('2 ' * n)
main()


from sys import stdin
for _ in range(int(stdin.readline())):
	print(*[1] * int(stdin.readline()))


for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		if i % 2 == 0:
			print(1, end=' ')
		else:
			print(100, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	d = -1
	for i in range(n):
		if i % 2 == 0:
			d += 2
		print(d, end=' ')
	print()


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	for x in range(int(input())):
		print(1, end=' ')
	print()


import sys
input = lambda : sys.stdin.readline().strip()
char = [chr(i) for i in range(97, 123)]
CHAR = [chr(i) for i in range(65, 91)]
mp = lambda : list(map(int, input().split()))
INT = lambda : int(input())
rn = lambda : range(INT())
from math import ceil, sqrt, factorial, gcd
for _ in rn():
	n = INT()
	l = []
	for i in range(1, n + 1):
		l.append(1)
	print(*l)


r = int(input())
for i in range(r):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	arr = [1] * n
	for a in arr:
		print(a, end=' ')
	print()


t = int(input())
while t > 0:
	n = int(input())
	li = []
	for i in range(n, 0, -1):
		li.append(5)
	print(*li)
	t -= 1


arr = [1] * 1001
t = int(input())
for _ in range(t):
	n = int(input())
	print(' '.join(map(str, arr[:n])))


T = int(input())
for t in range(T):
	n = int(input())
	for i in range(n):
		print('1', end=' ')
	print()


c = int(input())
for x in range(c):
	l = int(input())
	print(' '.join(['1' for x in range(l)]))


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n
avl = AvlTree()

class SegmentTree1:

	def __init__(self, data, default='z', func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
for i in range(int(input())):
	n = int(input())
	l = [1] * n
	print(*l, sep=' ')


import sys, bisect, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
rep = range

def Golf():
	(n, *t) = map(int, open(0).read().split())

def I():
	return int(input())

def S_():
	return input()

def IS():
	return input().split()

def LS():
	return [i for i in input().split()]

def MI():
	return map(int, input().split())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def RA():
	return map(int, open(0).read().split())

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in R(V)]
	FromStdin = True if ls == None else False
	for i in R(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

def gcd(x, y):
	if y == 0:
		return x
	if x % y == 0:
		return y
	while x % y != 0:
		(x, y) = (y, x % y)
	return y

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
l_alp = string.ascii_lowercase
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
show_flg = False
show_flg = True
ans = 0
for i in rep(I()):
	ans = 0
	n = I()
	ans = [2 * i + 1 for i in rep((n + 1) // 2)] * 2
	print(*ans[:n])


from math import *
from collections import *
from operator import itemgetter
import bisect
from heapq import *
i = lambda : input()
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
I = lambda : list(map(int, input().split()))
chrIdx = lambda x: ord(x) - 96
idxChr = lambda x: chr(96 + x)
t = ii()
for _ in range(t):
	n = ii()
	print('1 ' * n)


t = int(input())
while t:
	t -= 1
	n = int(input())
	odd = 1
	for i in range(n):
		print(odd, end=' ')
		odd += 2
		if odd > 400:
			odd = 1
	print()


t = int(input())
for h in range(t):
	n = int(input())
	for i in range(n):
		print(i - i + 1, end=' ')
	print()


def main():
	n = int(input())
	for i in range(n):
		N = int(input())
		res = []
		for i in range(N):
			if i % 2 == 0:
				res.append(1)
			else:
				res.append(900)
		p = ''
		for i in range(len(res)):
			if i != len(res) - 1:
				p += str(res[i]) + ' '
			else:
				p += str(res[i])
		print(p)
main()


t = int(input())
for i in range(t):
	n = int(input())
	print(('1 ' * n).rstrip())


for _ in range(int(input())):
	x = int(input())
	print('1 ' * x)


t = int(input())
for i in range(t):
	lst1 = []
	n = int(input())
	if n < 7:
		for i in range(0, n):
			lst1.append(pow(3, i))
		for i in range(len(lst1)):
			print(lst1[i], end=' ')
		print()
	else:
		lst1 = [1, 3, 9, 27, 81, 243]
		for i in range(n - 6):
			lst1.append(384)
		for i in range(len(lst1)):
			print(lst1[i], end=' ')
		print()


t = int(input())
for k in range(t):
	n = int(input())
	now = 1
	for i in range(n // 2):
		print(now, now, end=' ')
		now += 2
	if n & 1:
		print(n)
	else:
		print()


from math import *
sInt = lambda : int(input())
mInt = lambda : map(int, input().split())
lInt = lambda : list(map(int, input().split()))
t = sInt()
for _ in range(t):
	n = sInt()
	a = [1]
	for i in range(n - 1):
		a.append(1)
	print(*a, sep=' ')


for _ in range(int(input())):
	t = int(input())
	l = []
	for i in range(t):
		l.append(int(1))
	print(*l)


for _ in range(int(input())):
	n = int(input())
	i = 1
	s = ''
	f = False
	while n > 0:
		if f:
			s += str(i) + ' '
			i += 2
			f = False
		else:
			s += str(i) + ' '
			f = True
		n -= 1
	print(s)


import sys
import math
import heapq
from collections import defaultdict, deque
from decimal import *

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
for _ in range(r()):
	n = r()
	print('1 ' * n)


for i in range(int(input())):
	print(*[1] * int(input()), sep=' ')


test = int(input())
i = 1
while i <= test:
	n = int(input())
	for j in range(n):
		print(1, end=' ')
	print()
	i += 1


for i in range(int(input())):
	x = int(input())
	ans = [1] * x
	for i in ans:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	A = n // 2 * [1]
	for i in range(n // 2, n):
		A.append(3)
	print(*A)


import sys
q = int(input())
for i in range(q):
	n = int(sys.stdin.readline())
	print('1 ' * n)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(1)
		continue
	for i in range(n // 2):
		print(1, 3, end=' ')
	if (n - 2) % 2 != 0:
		print(1, end=' ')
	print()


import math
import datetime
import collections
import statistics
import itertools

def is_prime(num):
	for i in range(2, int(math.sqrt(num)) + 1):
		if num % i == 0:
			return False
	return True

def input_list():
	ll = list(map(int, input().split(' ')))
	return ll
tc = int(input())
for _ in range(tc):
	n = int(input())
	x = [1] * n
	for i in x:
		print(i, end=' ')
	print(' ')


def examA():
	T = I()
	ans = []
	for _ in range(T):
		N = I()
		cur = [1 for _ in range(N)]
		ans.append(cur)
	for v in ans:
		print(' '.join(map(str, v)))
	return

def examB():
	T = I()
	ans = []
	for _ in range(T):
		cur = 0
		ans.append(cur)
	for v in ans:
		print(v)
	return

def examC():
	T = I()
	ans = []
	for _ in range(T):
		cur = 0
		ans.append(cur)
	for v in ans:
		print(v)
	return

def examD():
	ans = 0
	print(ans)
	return

def examE():
	ans = 0
	print(ans)
	return

def examF():
	ans = 0
	print(ans)
	return
from decimal import getcontext, Decimal as dec
import sys, bisect, heapq
from copy import deepcopy
from heapq import heappop, heappush, heapify
from collections import Counter, defaultdict, deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def I():
	return int(input())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def DI():
	return dec(input())

def LDI():
	return list(map(dec, sys.stdin.readline().split()))

def LSI():
	return list(map(str, sys.stdin.readline().split()))

def LS():
	return sys.stdin.readline().split()

def SI():
	return sys.stdin.readline().strip()
global mod, mod2, inf, alphabet, _ep
mod = 10 ** 9 + 7
mod2 = 998244353
inf = 10 ** 18
_ep = dec('0.000000000001')
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}
getcontext().prec = 28
sys.setrecursionlimit(2 * 10 ** 5)
examA()


import os
import sys
from io import BytesIO, IOBase
profile = 0
pypy = 1

def iin():
	return int(input())

def lin():
	return list(map(int, input().split()))

def main():
	T = iin()
	while T:
		T -= 1
		n = iin()
		print(*[1] * n)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if pypy:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')
if profile:
	import cProfile
	cProfile.run('main()')
else:
	main()


from sys import stdin

def input():
	return stdin.readline()
T = int(input())
for _ in range(T):
	n = int(input())
	an = ''
	for _ in range(n):
		an += '1 '
	print(an.strip())


import sys
from math import sqrt
input = sys.stdin.readline

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def main():
	t = inp()
	for l in range(t):
		n = inp()
		for i in range(n - 1):
			print(1, end=' ')
		print(3)
main()


for _ in range(int(input())):
	n = int(input())
	z = 1
	for _ in range(n):
		print(z, end=' ')
	print()


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip().split()]

def st():
	return str(input().rstrip())[2:-1]

def val():
	return int(input().rstrip())

def li2():
	return [str(i)[2:-1] for i in input().rstrip().split()]

def li3():
	return [int(i) for i in st()]
for _ in range(val()):
	n = val()
	l = [0] * n
	curr = 1
	for i in range(n):
		l[i] = curr
	print(*l)


from collections import defaultdict, Counter
from math import log, ceil, floor

def solve():
	n = int(input())
	print(*[1] * n)
t = 1
t = int(input())
for _ in range(t):
	solve()


def solve():
	n = int(input())
	ans = ['1000'] * n
	print(' '.join(ans))
t = int(input())
for _ in range(t):
	solve()


T = int(input())
for i in range(T):
	n = int(input())
	for j in range(n):
		print('1', end=' ')
	print('')


for _ in range(int(input())):
	n = int(input())
	ans = [0] * n
	for i in range(n):
		ans[i] = 1
	print(*ans)


for _ in range(int(input())):
	N = int(input())
	for i in range(N):
		print(1, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	z = []
	for j in range(0, n):
		z.append('1')
	print(*z)


T = int(input())
for t in range(T):
	N = int(input())
	a = []
	for i in range(N):
		a.append(str(1000))
	print(' '.join(a))


from collections import deque
from math import *
import heapq
t = int(input())
for i in range(t):
	n = int(input())
	l = [2] * n
	print(*l)


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	for i in range(n):
		if i & 1 == 0:
			l.append(2)
		else:
			l.append(3)
	print(*l)


n1 = int(input())
for x in range(n1):
	n2 = int(input())
	for y in range(n2):
		print('2', end=' ')
	print('')


t = int(input())
for tt in range(0, t):
	n = int(input())
	x = [' ', '1'] * n
	x.remove(x[0])
	c = ''
	d = c.join(x)
	print(d)


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	n = Int()
	print(*[1 for i in range(n)])


t = int(input())
for i in range(t):
	n = int(input())
	l = ['100' for i in range(n)]
	s = ' '.join(l)
	print(s)


count = int(input())
for i in range(count):
	leng = int(input())
	for _ in range(leng):
		print('1', end=' ')
	print('')


from collections import deque
for _ in range(int(input())):
	n = int(input())
	l = deque()
	i = 0
	k = 1
	while i != n:
		l.append(2 * k - 1)
		k = 2 * k - 1
		i += 1
	print(*l)


def solve(n):
	print(*[1] * n)
for _icase in range(int(input())):
	n = int(input())
	solve(n)


def ans(n):
	a = [str(1) for i in range(n)]
	s = ' '.join(a)
	return s
m = int(input())
for i in range(m):
	n = int(input())
	print(ans(n))


def solve(t):
	if not t:
		return
	n = int(input())
	for i in range(0, n):
		print(1, end=' ')
	print()
	solve(t - 1)
tests = int(input())
solve(tests)


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	l = [i // 2 * 2 + 1 for i in range(n)]
	print(*l)


for _ in ' ' * int(input()):
	a = int(input())
	print('2 ' * (a - 1) + '9 ')


tc = int(input())
for _ in range(tc):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


for i in range(int(input())):
	b = int(input())
	print('1 ' * b)


t = int(input())
for i in range(t):
	n = int(input())
	st = ' '.join(n * '1')
	print(st)


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
import itertools

def Int():
	return int(sys.stdin.readline())

def Mint():
	return map(int, sys.stdin.readline().split())

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

def List():
	return list(map(int, sys.stdin.readline().split()))

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def solution():
	for i in range(Int()):
		n = Int()
		ans = []
		for i in range(n * 2):
			if i % 2 != 0:
				ans.append(i)
				ans.append(i)
		print(*ans[0:n])
solution()


exec(int(input()) * "print(int(input())*'1 ');")


t = int(input())
for i in range(0, t):
	n = int(input())
	for j in range(0, n):
		print(2, end=' ')
	print('')


for x in range(int(input())):
	z = int(input())
	for i in range(z):
		print(1, end=' ')
	print()


def ans(a):
	for i in range(0, a, 1):
		print(a, end=' ')
	print()
t = int(input())
while t > 0:
	a = int(input())
	ans(a)
	t -= 1


import sys

def solve(n):
	return [1] * n
caseCount = int(next(sys.stdin))
for i in range(caseCount):
	n = int(next(sys.stdin))
	print(' '.join([str(i) for i in solve(n)]))


for _ in range(int(input())):
	n = int(input())
	lst = [44] * n
	print(*lst)


import sys, math, cmath, time
start_time = time.time()

def solve():
	n = inp()
	print(*[1] * n)

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def counter(a, qw):
	q = [0] * qw
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = (q[ord(a[i]) - 97], 1)
	return q

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	b = [[0] * n for i in range(n)]
	for i in range(len(a)):
		for j in range(len(a)):
			b[i][j] = a[j][i]
	return b
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


ii = lambda : int(input())
from collections import *
for _ in range(ii()):
	n = ii()
	a = []
	for i in range(0, n):
		a.append(1)
	print(*a)


t = int(input())
for i in range(t):
	n = int(input())
	if n <= 500:
		l = []
		i = 1
		while n != 0:
			l.append(i)
			i += 2
			n -= 1
	else:
		l = [i for i in range(1, 1000, 2)]
		i = 1
		while n - 500 > 0:
			l.append(i)
			i += 2
			n -= 1
	print(*l)


t = int(input())
for _ in range(t):
	n = int(input())
	print(*n * [4])


import sys
import math
from decimal import *

def I():
	return int(sys.stdin.readline())

def IL():
	return list(map(int, sys.stdin.readline().strip().split()))

def ILS():
	return list(map(str, sys.stdin.readline().strip().split()))

def solve():
	tt = I()
	for ii in range(tt):
		n = I()
		for i in range(n):
			print(1, end=' ')
		print()
		pass
solve()


t = int(input())
a = []
for i in range(t):
	a.append(int(input()))
for i in range(t):
	for j in range(a[i]):
		print('42', end=' ')
	print('')


import heapq as hq
from heapq import heappop, heappush
from collections import deque, defaultdict

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def subset_sum_count(arr, n, sum):
	dp = [[0 for _ in range(sum + 1)] for _ in range(n + 1)]
	for i in range(n + 1):
		for j in range(sum + 1):
			if j == 0:
				dp[i][j] = 1
			elif arr[i - 1] <= j:
				dp[i][j] = dp[i - 1][j - arr[i - 1]] + dp[i - 1][j]
			else:
				dp[i][j] = dp[i - 1][j]
	return dp[n][sum]

def prefix(a):
	pre = []
	pre.append(a[0])
	for i in range(1, len(a)):
		pre.append(pre[i - 1] + a[i])
	return pre

def binary_search(func, lo, hi, abs_prec=1e-07):
	while abs(hi - lo) > abs_prec:
		mi = lo + (hi - lo) / 2
		if func(mi):
			hi = mi
		else:
			lo = mi
	return (lo + hi) / 2

def ternary_search(func, lo, hi, abs_prec=1e-07):
	while abs(hi - lo) > abs_prec:
		lo_third = lo + (hi - lo) / 3
		hi_third = hi - (hi - lo) / 3
		if func(lo_third) < func(hi_third):
			lo = lo_third
		else:
			hi = hi_third
	return (lo + hi) / 2

def discrete_binary_search(func, lo, hi):
	while lo < hi:
		mi = lo + (hi - lo) // 2
		if func(mi):
			hi = mi
		else:
			lo = mi + 1
	return lo

def discrete_ternary_search(func, lo, hi):
	while lo <= hi:
		lo_third = lo + (hi - lo) // 3
		hi_third = lo + (hi - lo) // 3 + (1 if 0 < hi - lo < 3 else (hi - lo) // 3)
		if func(lo_third) < func(hi_third):
			lo = lo_third + 1
		else:
			hi = hi_third - 1
	return lo
	return -1

def right_rotate(a, s):
	return a[s:] + a[:s]

def dec_to_bin(x):
	return int(bin(x)[2:])

def str_to_integer_list(n):
	a = []
	for i in range(len(n)):
		a.append(int(n[i]))
	return a

def list_to_str(l):
	s = ''
	for i in l:
		s += str(i)
	return s

def dijkstra(s, N, E):
	visited = set()
	dist = {}
	for i in range(1, N + 1):
		dist[i] = 1 << 29
	queue = [(dist[i], i) for i in range(1, N + 1)]
	hq.heappush(queue, (0, s))
	dist[s] = 0
	while queue:
		(d, u) = hq.heappop(queue)
		if u in visited:
			continue
		for t in E[u]:
			(v, r) = t
			if dist[v] > d + r:
				dist[v] = d + r
				hq.heappush(queue, (dist[v], v))
		visited.add(u)
	return dist

def prime_sieve(n):
	flag = n % 6 == 2
	sieve = bytearray((n // 3 + flag >> 3) + 1)
	for i in range(1, int(n ** 0.5) // 3 + 1):
		if not sieve[i >> 3] >> (i & 7) & 1:
			k = 3 * i + 1 | 1
			for j in range(k * k // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
			for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
	return sieve

def prime_list(n):
	res = []
	if n > 1:
		res.append(2)
	if n > 2:
		res.append(3)
	if n > 4:
		sieve = prime_sieve(n + 1)
		res.extend((3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not sieve[i >> 3] >> (i & 7) & 1))
	return res

def dijkstra(n, graph, start):
	(dist, parents) = ([float('inf')] * n, [-1] * n)
	dist[start] = 0
	queue = [(0, start)]
	while queue:
		(path_len, v) = heappop(queue)
		if path_len == dist[v]:
			for (w, edge_len) in graph[v]:
				if edge_len + path_len < dist[w]:
					(dist[w], parents[w]) = (edge_len + path_len, v)
					heappush(queue, (edge_len + path_len, w))
	return (dist, parents)

def path(start, end, parent):
	path = [end]
	while path[-1] != start:
		path.append(parent[path[-1]])
	path.reverse()
	return path

def bfs(graph, start, goal):
	if start == goal:
		return [start]
	visited = {start}
	queue = deque([(start, [])])
	while queue:
		(current, path) = queue.popleft()
		visited.add(current)
		for neighbor in graph[current]:
			if neighbor == goal:
				return path + [current, neighbor]
			if neighbor in visited:
				continue
			queue.append((neighbor, path + [current]))
			visited.add(neighbor)
	return None
import os
import sys
from io import BytesIO, IOBase

def p(board):
	for i in range(8):
		s = ''
		for j in range(8):
			s += board[i][j]
		print(s)

def main():
	for x in range(inp()):
		n = inp()
		a = [1] * n
		print(*a)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
T = int(input())
for t in range(T):
	n = int(input())
	for i in range(n):
		print('11', end=' ')
	print('')


def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	n = read_int()
	ans = [i + 1 - i % 2 for i in range(n)]
	print(' '.join(map(str, ans)))


t = int(input())
for i in range(t):
	n = int(input())
	a = []
	p = []
	from collections import defaultdict
	d = defaultdict()
	for i in range(1, 1001, 2):
		a.append(i)
		a.append(i)
	print(*a[:n])


t = int(input())
while t > 0:
	n = int(input())
	lst = list()
	ele = 1
	for i in range(n // 2):
		lst.append(ele)
		lst.append(ele)
		ele += 2
	if n % 2 != 0:
		lst.append(ele)
	for ele in lst:
		print(ele, end=' ')
	print()
	t -= 1


for t in range(int(input())):
	N = int(input())
	l = []
	for i in range(N):
		l.append(1)
	print(*l)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
A = []
for i in range(500):
	A.append(2 * i + 1)
	A.append(2 * i + 1)
T = int(input())
for _ in range(T):
	n = L()[0]
	print(*A[:n])


n = int(input())
for i in range(n):
	c = int(input())
	for j in range(c):
		print(1, end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	a = 99
	for j in range(n):
		print(a, end=' ')
		a = 99
	print(' ')


for _ in range(int(input())):
	n = int(input())
	d = 1
	for i in range(n):
		print(d, end=' ')
	print()


import math
inf = int(10000000000.0)
t = int(input())
while t:
	t -= 1
	n = int(input())
	print(*[1] * n)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		n = ri()
		a = [1] * n
		print(*a)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


for _ in range(int(input())):
	a = int(input())
	x = [2 for i in range(a)]
	print(*x)


import sys
input = sys.stdin.readline
scan_int = lambda : int(input())
scan_string = lambda : input().rstrip()
read_list = lambda : list(read())
read = lambda : map(int, input().split())
read_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(beauty, s, n, count):
	pass
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
import bisect as bis
import random
import sys

def solve():
	n = int(input())
	a = [1] * n
	print(*a)
for _ in range(int(input())):
	solve()


t = int(input(''))
x = []
for i in range(t):
	x.append(int(input('')))
for i in range(t):
	y = [13] * x[i]
	print(*y)


T = int(input())
while T != 0:
	T -= 1
	n = int(input())
	print(' '.join(['1'] * n))


for _ in range(int(input())):
	n = int(input())
	for _i in range(n):
		print(1, end=' ')
	print()


for o in range(int(input())):
	print(*[1] * int(input()))


t = int(input())
for u in range(t):
	n = int(input())
	a = [1 for i in range(n)]
	print(*a)


t = int(input())
while t > 0:
	n = int(input())
	out = [str(n)] * n
	out = ' '.join(out)
	print(out)
	t -= 1


import os
from sys import stdin, stdout

def solve(tc):
	n = int(stdin.readline().strip())
	print(' '.join(['1' for i in range(n)]))
tcs = 1
tcs = int(stdin.readline().strip())
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


from collections import defaultdict
for t in range(int(input())):
	n = int(input())
	arr = [2] * n
	for i in arr:
		print(i, end=' ')
	print()


T = int(input())
for _ in range(0, T):
	N = int(input())
	for i in range(0, N):
		print(1, end=' ')
	print()


import math
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(1)
	else:
		a = [1000, 1000]
		for i in range(math.ceil((n - 2) / 2)):
			a.append(a[-1] - 1)
			a.append(a[-2] - 1)
		if n % 2 != 0:
			a = a[:n]
		print(*a, sep=' ')


for i in range(int(input())):
	print(str('1 ' * int(input()))[:-1])


import sys
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))
t = inp()
for _ in range(t):
	n = inp()
	res = [1] * n
	print(*res)


from sys import stdin, stdout
import sys
from math import *
for __ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


def nod(a, b):
	while a != b:
		(a, b) = (max(a, b), min(a, b))
		if a % b == 0:
			a -= (a // b - 1) * b
		else:
			a -= a // b * b
	return a
a = [1] * 1000
for i in range(int(input())):
	print(*a[:int(input())])


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for j in range(n):
		l.append(n)
	for j in range(n):
		print(l[j], end=' ')
	print()


t = int(input())
for i in range(t):
	k = int(input())
	for i in range(k):
		print(2, end=' ')
	print()


tt = int(input())
for loop in range(tt):
	n = int(input())
	ans = [1] * n
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	g = [1] * n
	print(*g)


T = int(input())
for _ in range(T):
	n = int(input())
	print(' '.join(map(str, [1000] * n)))


n = int(input())
for _ in range(n):
	s = 0
	t = int(input())
	for i in range(t):
		print('5', end=' ')
	print('')


def answer(n):
	return [1] * n
t = int(input())
for i in range(t):
	n = int(input())
	print(*answer(n))


import sys
import math
from collections import defaultdict, Counter
t = int(input())
for i in range(t):
	n = int(input())
	print(*[1] * n)


ans = []
for j in range(1000):
	if j % 2 == 1:
		ans.append(j)
		ans.append(j)
for i in range(int(input())):
	z = int(input())
	print(*ans[:z], sep=' ')


t = int(input())
for s in range(t):
	n = int(input())
	for i in range(n):
		print(1, end=' ')
	print()


import math
t = int(input())
rez = []
for i in range(t):
	n = int(input())
	a = ''
	for j in range(n):
		a += '1 '
	rez.append(a)
for i in range(len(rez)):
	print(rez[i])


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')
from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def main():
	for _ in range(N()):
		n = N()
		arr = [1] * n
		print(*arr)
main()


for _ in range(int(input())):
	n = int(input())
	arr = [9] * n
	for i in arr:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	arr = [389] * n
	print(*arr)


for _ in range(int(input())):
	n = int(input())
	l = []
	x = 1
	for i in range(n // 2):
		l.append(x)
		x = x + 2
	o = l + l
	if n % 2 == 1:
		o.append(999)
	print(*o)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	ans = []
	for _ in range(n):
		k = I()
		ans.append([1] * k)
	for x in ans:
		print(' '.join((str(a) for a in x)))
main()


t = int(input())
for _ in range(t):
	n = int(input())
	out = []
	for __ in range(n):
		out.append(2)
	print(*out)


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))

def solve():
	n = int(input())
	ls = [1] * n
	print(*ls)

def main():
	solve()
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


t = int(input())
for __ in range(t):
	n = int(input())
	for i in range(n):
		print(3, end=' ')
	print()


t = int(input())

def print_arr(n):
	print('1 ' * n)
while t > 0:
	n = int(input())
	print_arr(n)
	t -= 1