Raavan gave a problem to his son, Indrajeet, and asked him to solve the problem to prove his intelligence and power. The Problem was like: Given 3 integers, $N$, $K$, and $X$, produce an array $A$ of length $N$, in which the XOR of all elements of each contiguous sub-array, of length $K$, is exactly equal to $X$. Indrajeet found this problem very tricky and difficult, so, help him to solve this problem.

-----Note:-----
- $A$i must be an integer between $0$ to $10$$18$ (both inclusive), where $A$i denotes the $i$$th$ element of the array, $A$.
- If there are multiple solutions, satisfying the problem condition(s), you can print any "one" solution.

-----Input:-----
- First line will contain $T$, number of testcases. Then, the testcases follow. 
- Each testcase, contains a single line of input, of 3 integers, $N$, $K$, and $X$.

-----Output:-----
For each testcase, output in a single line, an array $A$ of $N$ integers, where each element of the array is between $0$ to $10$$18$ (both inclusive), satisfying the conditions of the problem, given by Raavan to his son.

-----Constraints:-----
- $1 \leq T \leq 1000$
- $1 \leq N \leq 10^3$
- $1 \leq K \leq N$
- $0 \leq X \leq 10$$18$

-----Sample Input:-----
3
5 1 4
5 2 4
5 3 4

-----Sample Output:-----
4 4 4 4 4
3 7 3 7 3
11 6 9 11 6

-----Explanation:-----
$Sample$ $Case$ $-$ $1$: Since, we can see, the XOR of all elements of all sub-arrays of length $1$, is equal to $4$, hence, the array {$4,4,4,4,4$}, is a valid solution to the $Sample$ $Case$ $-$ $1$. All contiguous sub-arrays of length $1$, of the output array $A$, are as follows:
[1,1]: {4} - XOR([1,1]) = $4$
[2,2]: {4} - XOR([2,2]) = $4$
[3,3]: {4} - XOR([3,3]) = $4$
[4,4]: {4} - XOR([4,4]) = $4$
[5,5]: {4} - XOR([5,5]) = $4$

Difficulty: interview

Starter code:

Solutions:
# cook your dish here
for _ in range(int(input())):
    l,n,x=map(int,input().split())
    m=[]
    pw1 = (1 << 17);  
    pw2 = (1 << 18);  
    if (n == 1) :  
        m.append(x)
    elif (n == 2 and x == 0) : 
        m.append(-1)
    elif (n == 2) : 
        m.append(x)
        m.append(0)
    else : 
        ans = 0;  
        for i in range(1, n - 2) : 
            m.append(i)
            ans = ans ^ i;     
        if (ans == x) : 
            m.append(pw1+pw2)
            m.append(pw1)
            m.append(pw2)
        else:
            m.append(pw1)
            m.append((pw1 ^ x) ^ ans)
            m.append(0)
    p=(m)*l
    for i in range(0,l):
        print(p[i],end=' ')
    print()    
        

# cook your dish here
for _ in range(int(input())):
    l,n,x=map(int,input().split())
    m=[]
    pw1 = (1 << 17);  
    pw2 = (1 << 18);  
    if (n == 1) :  
        m.append(x)
    elif (n == 2 and x == 0) : 
        m.append(-1)
    elif (n == 2) : 
        m.append(x)
        m.append(0)
    else : 
        ans = 0;  
        for i in range(1, n - 2) : 
            m.append(i)
            ans = ans ^ i;     
        if (ans == x) : 
            m.append(pw1+pw2)
            m.append(pw1)
            m.append(pw2)
        else:
            m.append(pw1)
            m.append((pw1 ^ x) ^ ans)
            m.append(0)
    p=(m)*l
    for i in range(0,l):
        print(p[i],end=' ')
    print()    
        

# cook your dish here
def main():
    for _ in range(int(input())):
        n,k,x=map(int,input().split())
        if k==1:
            for i in range(n):
                print(x,end=" ")
            print()
        else:
            def compxor(n) :  
                if n % 4 == 0 :
                    return n
                if n % 4 == 1 :
                    return 1  
                if n % 4 == 2 :
                    return n + 1
                return 0
            q=x^(compxor(k-1))
##            print(q)
            l=[i for i in range(1,k)]
            l.append(q)
##            print(l)
            if n<=len(l):
                print(" ".join(map(str,l[:n])))
            else:
                j=0
                for i in range(n):
                    print(l[j],end=" ")
                    if j==len(l)-1:
                        j=0
                    else:
                        j+=1
                print()                

main()



# cook your dish here
for ad in range(int(input())):
    n,k,x=list(map(int,input().split()))
    l=[0]*(k-1)
    l.append(x)
    l=l*(n//k)+l
    l=l[:n]
    for i in range(n):
        print(l[i],end=" ")
    print()


from math import radians
from heapq import heapify, heappush, heappop
import bisect
from math import pi
from collections import deque
from math import factorial
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
# from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
# from bisect import bisect_left,bisect_right
# from decimal import *,threading
from fractions import Fraction
mod = int(pow(10, 9)+7)
# mod = 998244353


def ii(): return int(input())


def si(): return str(input())


def mi(): return map(int, input().split())


def li1(): return list(mi())


def fii(): return int(stdin.readline())


def fsi(): return str(stdin.readline())


def fmi(): return map(int, stdin.readline().split())


def fli(): return list(fmi())


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}


def getKey(item): return item[0]


def sort2(l): return sorted(l, key=getKey)


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 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


graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000


def bfs(d, v):
    q = []
    q.append(v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.append(i)
        print(x)


def make_graph(e):
    d = {}
    for i in range(e):
        x, y = mi()
        if x not in d:
            d[x] = [y]
        else:
            d[x].append(y)
        if y not in d:
            d[y] = [x]
        else:
            d[y].append(x)
    return d


def gr2(n):
    d = defaultdict(list)
    for i in range(n):
        x, y = mi()
        d[x].append(y)
    return d


def connected_components(graph):
    seen = set()

    def dfs(v):
        vs = set([v])
        component = []
        while vs:
            v = vs.pop()
            seen.add(v)
            vs |= set(graph[v]) - seen
            component.append(v)
        return component

    ans = []
    for v in graph:
        if v not in seen:
            d = dfs(v)
            ans.append(d)
    return ans


def primeFactors(n):
    s = set()
    while n % 2 == 0:
        s.add(2)
        n = n // 2
    for i in range(3, int(sqrt(n)) + 1, 2):
        while n % i == 0:
            s.add(i)
            n = n // i
    if n > 2:
        s.add(n)
    return s


def find_all(a_str, sub):
    start = 0
    while True:
        start = a_str.find(sub, start)
        if start == -1:
            return
        yield start
        start += len(sub)


def SieveOfEratosthenes(n, isPrime):
    isPrime[0] = isPrime[1] = False
    for i in range(2, n):
        isPrime[i] = True
    p = 2
    while (p * p <= n):
        if (isPrime[p] == True):
            i = p * p
            while (i <= n):
                isPrime[i] = False
                i += p
        p += 1
    return isPrime


def dijkstra(edges, f, t):
    g = defaultdict(list)
    for l, r, c in edges:
        g[l].append((c, r))

    q, seen, mins = [(0, f, ())], set(), {f: 0}
    while q:
        (cost, v1, path) = heappop(q)
        if v1 not in seen:
            seen.add(v1)
            path = (v1, path)
            if v1 == t:
                return (cost, path)

            for c, v2 in g.get(v1, ()):
                if v2 in seen:
                    continue
                prev = mins.get(v2, None)
                next = cost + c
                if prev is None or next < prev:
                    mins[v2] = next
                    heappush(q, (next, v2, path))
    return float("inf")


def binsearch(a, l, r, x):
    while l <= r:
        mid = l + (r-1)//2
        if a[mid]:
            return mid
        elif a[mid] > x:
            l = mid-1
        else:
            r = mid+1
    return -1


# def input():
#    return stdin.buffer.readline()


def readTree(n):
    adj = [set() for _ in range(n)]
    for _ in range(n-1):
        u, v = map(int, input().split())
        adj[u-1].add(v-1)
        adj[v-1].add(u-1)
    return adj


def treeOrderByDepth(n, adj, root=0):
    parent = [-2] + [-1]*(n-1)
    ordered = []
    q = deque()
    q.append(root)
    depth = [0] * n
    while q:
        c = q.popleft()
        ordered.append(c)
        for a in adj[c]:
            if parent[a] == -1:
                parent[a] = c
                depth[a] = depth[c] + 1
                q.append(a)
    return (ordered, parent, depth)


for _ in range(ii()):
    n,k,x=mi()
    l=[]
    for i in range(n):
        if i%k==0:
            l.append(x)
        else:
            l.append(0)
    print(*l)

# cook your dish here
def main():
    for _ in range(int(input())):
        n,k,x=map(int,input().split())
        if k==1:
            for i in range(n):
                print(x,end=" ")
            print()
        else:
            def compxor(n) :  
                if n % 4 == 0 : 
                    return n 
                if n % 4 == 1 : 
                    return 1  
                if n % 4 == 2 : 
                    return n + 1
                return 0
            q=x^(compxor(k-1))
            l=[i for i in range(1,k)]
            l.append(q)
            if n<=len(l):
                print(" ".join(map(str,l[:n])))
            else:
                j=0
                for i in range(n):
                    print(l[j],end=" ")
                    if j==len(l)-1:
                        j=0
                    else:
                        j+=1
                print()                

main()

# cook your dish here
t = int(input())

while(t>0):
    t-=1
    n, k, x = list(map(int, input().split()))
    while(n>0):
        n-=1
        print(x, end=' ')
        for i in range(k-1):
            if(n>0):
                print(0, end=' ')
                n-=1
    print('\n')

# cook your dish here
t = int(input())
while t:
    n, k, x = list(map(int, input().split()))
    arr = [x]
    for i in range(k-1):
        arr.append(0)
    j = 0
    for i in range(n):
        print(arr[j], end = " ")
        j += 1
        if j == k:
            j = 0
    print()
    t -= 1

from math import ceil

for T in range(int(input())):
    N, K, X = map(int, input().split())
    print(' '.join(map(str, (([X] + [0] * (K - 1)) * ceil(N/K))[:N])))

from math import ceil

def raavan(N, K, X):
    return ' '.join(map(str, (([X] + [0] * (K - 1)) * ceil(N/K))[:N]))

for T in range(int(input())):
    N, K, X = map(int, input().split())
    print(raavan(N, K, X))

t = int(input())

while(t>0):
    t-=1
    n, k, x = list(map(int, input().split()))
    while(n>0):
        n-=1
        print(x, end=' ')
        for i in range(k-1):
            if(n>0):
                print(0, end=' ')
                n-=1
    print('\n')

t=int(input())
for i in range(t):
    n,k,x=map(int,input().split())
    X=[x]
    for i in range(0,k-1):
        X.append(0)
    i=0
    v=[]
    j=0
    while(j<n):
        v.append(X[i])
        i+=1
        if i==len(X):
            i=0
        j+=1
    print(*v)
        

"""

    Author - AYUSHMAN CHAHAR #

"""

import bisect
import math
import heapq
import itertools
import sys
#import numpy
from itertools import combinations
from itertools import permutations
from collections import deque
from atexit import register
from collections import Counter
from functools import reduce
sys.setrecursionlimit(10000000)

if sys.version_info[0] < 3:
    from io import BytesIO as stream
else:
    from io import StringIO as stream
  
if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)
 
        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)
 
        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)
 
    input = raw_input
    range = xrange
 
    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip
 
 
def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.
 
    Args:
        sync (bool, optional): The new synchronization setting.
 
    """
    global input, flush
 
    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')
 
        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))
 
def main():
    
	for _ in range(int(eval(input()))):
		n, length, xored = list(map(int, input().split()))
		ans = [-1] * n
		templ = [0] * (length - 1)
		templ.append(xored)
		#print(templ)
		temp = n % length
		for i in range(len(templ)):
			templ.append(templ[i])
		start = 0
		for i in range(len(ans)):
			ans[i] += (templ[start] + 1)
			#print(ans)
			#print(templ[start])
			start += 1
			if start == len(templ):
				start = 0
		print(*ans) 
		
def __starting_point():
    sync_with_stdio(False)
    main()
 

__starting_point()

t = int(input())

while(t>0):
    t-=1
    n, k, x = list(map(int, input().split()))
    while(n>0):
        n-=1
        print(x, end=' ')
        for i in range(k-1):
            if(n>0):
                print(0, end=' ')
                n-=1
    print('\n')

# cook your dish here
 # Let's hack this code.

from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left

mod = 1000000007

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

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

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

def printIn(ob):
    return stdout.write(str(ob))

def powerLL(n, p):
    result = 1
    while (p):
        if (p&1):
            result = result * n % mod
        p = int(p / 2)
        n = n * n % mod
    return result

#--------------------------------------

def myCode():
    n,k,x = In()
    res = []
    j = 0
    if k == 1:
        res = [x for i in range(n)]
    else:
        while j<n:
            i = 0
            while j<n and i<k:
                if i == k-1:
                    res.append(x)
                else:
                    res.append(0)
                i+=1
                j+=1
    for i in range(n):
        print(res[i],end=' ')
    print("")
    
def main():
    for t in range(I()):
        myCode()
def __starting_point():
    main()

__starting_point()

# cook your dish here
for _ in range(int(input())):
    n ,k ,x = list(map(int,input().split()))
    l = [0]*n
    for i in range(0,n,k):
        l[i] = x
    l = list(map(str,l))
    print(' '.join(l))

            
        

# cook your dish here
for _ in range(int(input())):
    n,k,x=map(int,input().split())
    a=[]
    if k%2==0:
        for i in range(1,k):
            a.append(0)
        a.append(x)
    else:
        for i in range(1,k):
            a.append(0)
        a.append(x)
    b=[]
    j=0
    for i in range(n):
        if j==len(a):
            j=0
        b.append(a[j])
        j=j+1
    for i in b:
        print(i,"",end="")
    print()

for _ in range(int(input())):
    n,k,x = map(int, input().split())
    
    a = n*[0]
    
    for i in range(0,n,k):
        a[i] = x
    print(*a)    

# cook your dish here
for k in range(int(input())):
	leng, cont, val = map(int, input().split())
	temp = cont*[0]
	temp[0] = val
	ans0 = (leng//cont)*temp + temp[:leng%cont]
	ans = ' '.join([str(x) for x in ans0])
	print(ans)

for i in range(int(input())):
    n,k,x=map(int,input().split())
    a=[]
    for i in range(n):
        if((i+1)%k!=0):
            a.append(0)
        else:
            a.append(x)
    print(*a)

for _ in range(int(input())):
    n,k,x = map(int, input().split())
    if k==1:
        for _ in range(n):
            print(x,end=" ")
        print()
        continue
    for i in range(n):
        if i%k==0:
            print(x, end=" ")
        else:
            print(0, end=" ")
    print()

# cook your dish here
for _ in range(int(input())):
	n,k,x=map(int,input().split())
	lst=list()
	while(len(lst)!=n):
		lst.append(x)
		if(len(lst)==n):
			break
		for i in range(k-1):
			lst.append(0)
			if(len(lst)==n):
				break
		#print(lst)
	print(*lst,end=" ")
	print()

# cook your dish here
for _ in range(int(input())):
    n,k,x=map(int,input().split())
    for i in range(n):
        if (i+1)%k==0 and i!=(n-1):
            print(x,end=' ')
        elif i==n-1:
            print(x if n%k==0 else 0)
        else:
            print(0,end=' ')

# cook your dish here
for _ in range(int(input())):
    n,k,x = map(int,input().split())
    a = []
    if( k == 1):
        for i in range(n):
            print(x,end = ' ')
    else:
        a.append(x)
        for i in range(k - 1):
            a.append(0)
        j = 0
        p = 0
        for i in range(n):
            if( i < len(a) - 1):
                print( a[i], end = ' ')
            else:
                j = i % len(a)
                print( a[j] , end = ' ')
    print()

# cook your dish here
from sys import stdin,stdout
from math import gcd,sqrt,ceil
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=1000000007
def power(base,power,modulus):
    res = 1
    while power:
        if power&1:
            res=(res*base)%modulus
        base=(base*base)%modulus
        power//=2
    return res
ma=1152921504606846976
t=ii1()
for i in range(t):
    n,k,x=map(int,input().split())
    for i in range(1,n+1):
        if i%k==0:
            print(x,end=' ')
        else:
            print(0,end=' ')
    print()