T = int(raw_input())
for loop in xrange(T):
	N = int(raw_input())
	a = map(int, raw_input().split())
	b = [0] * N
	for i, ai in enumerate(a):
		b[ai - 1] = i + 1
	print "inverse" if a == b else "not inverse"