for t in range(input()):
 n=int(raw_input())+1
 lst=map(int,raw_input().split())
 check=[0]*n
 for i in range(n):
  check[lst[i-1]]=i
 check.pop(0)
 if lst==check:
  print "inverse"
 else:
  print "not inverse"