def test():
    n = int(raw_input())
    new_list = [0]*n
    old_list = [ int(i) for i in raw_input().split()]
    for i in range(n):
        new_list[old_list[i]-1] =  i+1
    inverse = True
    for i,j in zip(old_list, new_list):
        if i != j:
            inverse = False
            break
    if inverse:
        print('inverse')
    else:
        print('not inverse')
    
n = int(input())
for i in range(n):
    test()