t=int(raw_input())
for case in range(t):
	n=int(raw_input())
	a=map(int,raw_input().split())
	viru=1
	for i in range(n):
		x=a[i]-1
		if a[x]!=i+1:
			viru=0
			break
	if viru==1:
		print "inverse"
	else:
		print "not inverse"