t = int(raw_input())
for p in range(t):
	n = int(raw_input())
	arr = list(map(int, raw_input().split()))
	newlist = [0 for i in range(n)]
	for i in range(n):
		newlist[arr[i] - 1] = i+1
	if arr == newlist:
		print('inverse')
	else:
		print('not inverse')