import sys
n=int(input())
A=[int(i) for i in input().split()]

N=10**6
spf = [i for i in range(N+1)]

for i in range(2,N):
    if i**2>N:
        break
    if spf[i] == i:
        for j in range(i**2,N+1,i):
            if spf[j] == j:
                spf[j] = i

def get(n):
    ps = set()
    while n != 1:
        ps.add(spf[n])
        n //= spf[n]
    return ps

f1=True
f2=True

n0 = list(get(A[0]))
K=set(n0)
J=set(n0)

for a in A[1:]:
    res = get(a)
    #print(K,J,res)
    
    if len(K & res) != 0:
        f1 = False
        
    if len(res) != 0:
        K &= res
        
    if len(J & res) !=0:
        f2 = False
        
    if len(res) != 0:
        J |= res
        
#print(K,J,res)        
        
if 1 in A:
    f1 = True

    
if f1:
    if f2:
        print("pairwise coprime")
    else:
        print("setwise coprime")
else:
    print("not coprime")