The chef is having one array of N natural numbers(numbers may be repeated). i.e. All natural numbers must be less than N. Chef wants to rearrange the array and try to place a natural number on its index of the array, i.e array[i]=i. If multiple natural numbers are found for given index place one natural number to its index and ignore others.i.e. arr[i]=i and multiple i found in array ignore all remaining i's If any index in the array is empty place 0 at that place. i.e. if for arr[i], i is not present do arr[i]=0.

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each testcase contains two lines of input.
- First-line has $N$ denoting the size of an array.
- Second-line has $N$ space-separated natural numbers.

-----Output:-----
For each test case, output in a single line with the new rearranged array.

-----Constraints-----
- $1 \leq T \leq 10^3$
- $2 \leq N \leq 10^3$
- $arr[i] \leq N-1$

-----Sample Input:-----
2
2
1 1
4
1 1 2 1

-----Sample Output:-----
0 1
0 1 2 0

-----EXPLANATION:-----
For 1) $1$ occurs twice in the array hence print 0 at 0th index and 1 at 1st index
For 2) $1$ occurs thrice and 2 once in the array hence print 0 at 0th index and 1 at 1st index, 2 at 2nd index and 0 at 3rd index.

Difficulty: UNKNOWN_DIFFICULTY

Solutions:
for t in range(int(input())):
	n = int(input())
	x = list(map(int, input().split()))
	x.sort()
	x = [i if i in x else 0 for i in range(n)]
	print(*x)


test = input()
for i in range(int(test)):
	N = int(input())
	arr = list(map(int, input().split()))
	ans = []
	for i in range(N):
		if i in arr:
			ans.append(i)
		else:
			ans.append(0)
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	for i in range(len(l)):
		if l[i] >= i:
			l[i] = i
		else:
			l[i] = 0
	print(*l)


for _ in range(int(input())):
	lens = int(input())
	has = set([int(x) for x in input().split()])
	rets = [0] * lens
	for i in range(lens):
		if i in has:
			rets[i] = i
	print(*rets)


n = input()
for i in range(int(n)):
	k = int(input())
	l = list(map(int, input().split()))
	f = []
	for i in range(k):
		if i in l:
			f.append(i)
		else:
			f.append(0)
	print(*f)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ans = []
	for i in range(n):
		if i in a:
			ans.append(i)
		else:
			ans.append(0)
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	m = list(set(l))
	m.sort()
	k = []
	for i in range(n):
		if i in m:
			k.append(i)
		else:
			k.append(0)
	print(*k)


from collections import Counter
try:
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		d = dict(Counter(a))
		new = []
		for i in range(0, n):
			if i in d:
				new.append(i)
			else:
				new.append(0)
		print(*new)
except:
	pass


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().strip().split()))
	a = list(set(arr))
	for i in range(n):
		if i in a:
			arr[i] = i
			a.remove(i)
		else:
			arr[i] = 0
	print(*arr)


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


try:
	t = int(input())
	for _ in range(t):
		n = int(input())
		l = [int(x) for x in input().split()]
		temp = [0] * n
		s = set()
		for ele in l:
			if ele not in s:
				s.add(ele)
		for i in range(n):
			l[i] = 0
		for i in range(0, n):
			if i in s:
				l[i] = i
		print(*l)
except EOFError:
	pass