for i in range(int(input())): n = int(input()) if n % 2 == 0: print('0 '*(n-1),end='') print(n) else: print(f'{n} '*(n))