for _ in xrange(input()):
	x=input()
	inverse=[]
	inverse.append(0)
	a=map(int,raw_input().split())
	a.insert(0,0)
	for i in xrange(1,len(a)):
		inverse.insert(a[a[i]],a[i])
		
	if(a==inverse):
		print "inverse"
	else:
		print "not inverse"