t = input()
while t > 0:
	t-=1
	n = input()
	a = map(int, raw_input().split())
	b = [0]*(n+1)
	for i in range(n):
		b[a[i]] = i+1
	inv = True
	for i in range(n):
		if a[i] != b[i+1]:
			inv = False
			break
	if inv == True:
		print "inverse"
	else:
		print "not inverse"