import sys
input = sys.stdin.readline

#n = int(input())
#l = list(map(int, input().split()))

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

def premf(n):
    #minfactor:複数の素因数分解を高速に行う,indexはその整数(前処理)
    #return resで素数リスト(eratosthenes),MinFactorで前処理用リスト返す
    IsPrime=[False]+[False]+[True]*(n-1)
    MinFactor=[0]+[1]+[-1]*(n-1)

    res=[]
    
    for i in range(2,n+1):
        if IsPrime[i]:
            MinFactor[i]=i
    
            res.append(i)
    
            for j in range(i*2,n+1,i):
                IsPrime[j]=False
                if MinFactor[j]==-1: MinFactor[j]=i
                
    return MinFactor

from collections import Counter

n=int(input())
a=list(map(int, input().split()))

l=premf(max(a))
#print(l)
ll=[]
for i in range(n):
    ll.append(l[a[i]])
#print(ll)
l2=Counter(ll)
#print(l2)
flg=True
fl2=False
for i in range(n):
    #print(l2[l[a[i]]])
    if l2[l[a[i]]]!=1:
        flg=False
    if (not flg) and l2[l[a[i]]]==1:
        fl2=True

if flg:
    print("pairwise coprime")
elif fl2:
    print("setwise coprime")
else:
    print("not coprime")

