There are many ways to order a list of integers from 1 to n. For example, if  n = 3, the list could be : [3\; 1\; 2].

But there is a special way to create another list from the given list of integers. In this list, position of integer i is the i-th number in the given list. So following this rule, the given list will be written as: [2\; 3\; 1]. This list is called inverse list. Now there exists some list whose inverse list is identical. For example, inverse list of [1\; 2\; 3] is same as given list. Given a list of integers you have to determine whether the list is inverse or not.

The input contains several test cases. The first line is the number of test cases t (1 ≤ t ≤ 100) . The first line of each test case contains an integer n \;(1 ≤ n ≤ 100000). Then a list of the integers 1 to n follows in the next line. 

SAMPLE INPUT
2
3
3 1 2
3
1 2 3

SAMPLE OUTPUT
not inverse
inverse
#!/bin/env python
import sys
stdin = sys.stdin

def check_inverse(n, numbers):
	#new_numbers = list(xrange(1,n+1))
	#a  =''.join(str(x) for x in new_numbers)
	#b  =''.join(str(x) for x in numbers)
	a = {}
	j = 1
	new_numbers = []
	for i in numbers :
		a[i] = j
		j+=1
	for i in a :
		new_numbers.append(a[i])
	#print new_numbers
	#print numbers
	if new_numbers == numbers :
		print "inverse"
	else :
		print "not inverse"

t = int(stdin.readline().strip())
for i in range(t) :
	n = int(stdin.readline().strip())
	numbers = map(int,raw_input("").strip().split())
	check_inverse(n, numbers)