from collections import Counter
N = int(input())
A = list(map(int,input().split()))

#pairwiseかどうかを調べる
primes = []
def primeFinder(n):
    memo = [1]*(n+1)
    memo[0] = 0
    memo[1] = 0
    for i in range(2,n+1):
        if memo[i] == 1:
            primes.append(i)
            for j in range(i*2,n+1,i):
                memo[j] = 0

primeFinder(10**6)
primes = {p:0 for p in primes}
"""
各Aiに関して素因数を算出。素因数を集計してカウントが2つある素因数がなければpairwise
"""
flag = True
for i in range(N):
    a = A[i]
    memo = []
    for d in primes.keys():
        if a%d == 0:
            memo.append(d)
            while a % d == 0:
                a //= d
    for d in memo:
      primes.pop(d)
    if a != 1:
        break
else:
    print("pairwise coprime")
    exit()


#setwise coprimeを判断
def gcd(a,b):
    return a if b==0 else gcd(b,a%b)

g = A[0]
for i in range(1,N):
    g = gcd(g,A[i])
if g == 1:
    print("setwise coprime")
else:
    print("not coprime")
