CodeEff/ECCO huggingface dataset:
# Original solution
from math import gcd
from functools import reduce
from collections import defaultdict


def facs(n):
    """試し割り法における割る数を生成する。"""
    yield 2
    for x in range(3, n, 2):
        yield x


def main():
    eval(input())  # N
    array = [int(x) for x in input().split()]
    MAX_A = 10 ** 6 + 1
    histogram = defaultdict(int)
    for x in array:
        histogram[x] += 1

    for potential_prime in facs(MAX_A):
        count = sum(
            histogram[divider]
            for divider in range(potential_prime, MAX_A, potential_prime))
        if count > 1:
            break
    else:
        return 'pairwise coprime'

    gcd_total = reduce(gcd, array)
    if gcd_total == 1:
        return 'setwise coprime'
    else:
        return 'not coprime'


if __name__ == '__main__':
    print((main()))


# Optimized solution
from math import gcd
from functools import reduce


def facs(n):
    """試し割り法における割る数を生成する。"""
    yield 2
    for x in range(3, n, 2):
        yield x


def main():
    eval(input())  # N
    array = [int(x) for x in input().split()]
    MAX_A = 10 ** 6 + 1
    histogram = [0] * MAX_A
    for x in array:
        histogram[x] += 1

    for divider in facs(MAX_A):
        count = sum(histogram[divider::divider])
        if count > 1:
            break
    else:
        return 'pairwise coprime'

    gcd_total = reduce(gcd, array)
    if gcd_total == 1:
        return 'setwise coprime'
    else:
        return 'not coprime'


if __name__ == '__main__':
    print((main()))
# Original solution
from collections import Counter 
import sys

N = int(eval(input()))
A = list(map(int, input().split()))

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A.sort()
if A[0] == 1:
    s = 0
else:
    d = prime_factorize(A[0])
    dlist = list(Counter(d).keys())
    for i in dlist:
        for j in range(1,N):
            if A[j] % i != 0:
                break
            if j == N-1:
                print("not coprime")
                sys.exit()


t = 0
cnt = [0] * (10 ** 6)
for i in A:
    a = prime_factorize(i)
    alist = list(Counter(a).keys())
    for j in alist:
        cnt[j] += 1
        if cnt[j] >= 2:
            t = 1
            break
    if t == 1:
        break

if t == 0:
    print("pairwise coprime")
else:
    print("setwise coprime")

    
    


# Optimized solution
from collections import Counter 
import sys

N = int(eval(input()))
A = list(map(int, input().split()))

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A.sort()
if A[0] != 1:
    d = prime_factorize(A[0])
    dlist = list(Counter(d).keys())
    for i in dlist:
        for j in range(1,N):
            if A[j] % i != 0:
                break
            if j == N-1:
                print("not coprime")
                sys.exit()


cnt = [0] * (10 ** 6)
for i in A:
    a = prime_factorize(i)
    alist = list(Counter(a).keys())
    for j in alist:
        cnt[j] += 1
        if cnt[j] >= 2:
            print("setwise coprime")
            sys.exit()

print("pairwise coprime")
# Original solution
import sys,random
from math import gcd
input=sys.stdin.readline
n=int(eval(input()))
*a,=list(map(int, input().split()))
random.shuffle(a)
tmp=a[0]
for i in range(1,n):
    tmp=gcd(tmp,a[i])
if tmp>1:
    print('not coprime')
    exit()

# pairwize coprime なら素因数が2度現れることはない

def f(x):
    res=set()
    for i in range(2,int(x**(1/2))+3):
        if x%i==0:
            while x%i==0:
                x//=i
            res.add(i)
    if x>1:
        res.add(x)
    return res,x
tmp=set()
tmp2=set()
for ai in a:
    for p in tmp:
        if ai%p==0:
            print('setwise coprime')
            exit()
    pp,x=f(ai)
    tmp|=pp 
    if x>1 and x in tmp2:
        print('setwise coprime')
        exit()
    tmp2.add(x)
    
        
print('pairwise coprime')



# Optimized solution
import sys,random
from math import gcd
input=sys.stdin.readline
n=int(eval(input()))
*a,=list(map(int, input().split()))
random.shuffle(a)
tmp=a[0]
for i in range(1,n):
    tmp=gcd(tmp,a[i])
if tmp>1:
    print('not coprime')
    exit()

# pairwize coprime なら素因数が2度現れることはない

def f(x):
    res=set()
    for i in range(2,int(x**(1/2))+3):
        if x%i==0:
            while x%i==0:
                x//=i
            res.add(i)
    return res,x
tmp=set()
tmp2=set()
for ai in a:
    for p in tmp:
        if ai%p==0:
            print('setwise coprime')
            exit()
    pp,x=f(ai)
    tmp|=pp 
    if x>1 and x in tmp2:
        print('setwise coprime')
        exit()
    tmp2.add(x)
    
        
print('pairwise coprime')
# Original solution
from math import gcd # Python3.6以降
# --------------------------------------------------------------

# n以下の素数列挙: O-nlogn
# def primes(n):
#     prs = []
#     is_prime = [True] * (n + 1)
#     is_prime[0] = False
#     is_prime[1] = False
#     for i in range(2, int(n**0.5)+1):
#         if not is_prime[i]:
#             continue
#         for j in range(i*2, n+1, i):
#             is_prime[j] = False
#     for i in range(len(is_prime)):
#         if is_prime[i]:
#             prs.append(i)
#     return prs

n    = int(eval(input()))
lis  = list(map(int,input().split()))
A    = 10**6
nlis = [0]*A
flg_pairwise = True

for i in range(n):
    nlis[lis[i]-1] += 1

for i in range(2,A):
    cnt = 0
    for j in range(i-1,A,i):
        cnt += nlis[j]
    if cnt > 1:
        flg_pairwise = False
        break

if flg_pairwise:
    print('pairwise coprime')
else:
    for i in range(n-1):
        if i==0:
            tmp = gcd(lis[i],lis[i+1])
        else:
            tmp = gcd(tmp,lis[i+1])

    if tmp==1:
        print('setwise coprime')
    else:
        print('not coprime')

# Optimized solution
from math import gcd # Python3.6以降
# --------------------------------------------------------------

# n以下の素数列挙: O-nlogn
def primes(n):
    prs = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]:
            continue
        for j in range(i*2, n+1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            prs.append(i)
    return prs

n    = int(eval(input()))
lis  = list(map(int,input().split()))
A    = 10**6
nlis = [0]*A
flg_pairwise = True

for i in range(n):
    nlis[lis[i]-1] += 1

for i in primes(A):
    cnt = 0
    for j in range(i-1,A,i):
        cnt += nlis[j]
    if cnt > 1:
        flg_pairwise = False
        break

if flg_pairwise:
    print('pairwise coprime')
else:
    for i in range(n-1):
        if i==0:
            tmp = gcd(lis[i],lis[i+1])
        else:
            tmp = gcd(tmp,lis[i+1])

    if tmp==1:
        print('setwise coprime')
    else:
        print('not coprime')
# Original solution
from math import gcd
n=int(eval(input()))
A=list(map(int,input().split()))
m=max(A)
l=[0 for _ in range(m)]
fp=True
for a in A:
    l[a-1]+=1
for i in range(2,m):
    cnt=0
    for j in range(i-1,m,i):
        cnt+=l[j]
        if cnt>1:
            fp=False
            break
g=0
fs=False
for a in A:
    g=gcd(g,a)
if g==1:
    fs=True

if fp:
    print("pairwise coprime")
elif fs:
    print("setwise coprime")
else:
    print("not coprime")

# Optimized solution
from math import gcd
def main():
    n=int(eval(input()))
    A=list(map(int,input().split()))
    m=max(A)
    l=[0 for _ in range(m)]
    fp=True
    for a in A:
        l[a-1]+=1
    for i in range(2,m):
        cnt=0
        for j in range(i-1,m,i):
            cnt+=l[j]
            if cnt>1:
                fp=False
                break
    g=0
    fs=False
    for a in A:
        g=gcd(g,a)
    if g==1:
        fs=True

    if fp:
        print("pairwise coprime")
    elif fs:
        print("setwise coprime")
    else:
        print("not coprime")
if __name__=="__main__":
    main()
# Original solution
import math
f=0
n=int(eval(input()))
a=list(map(int,input().split()))
p = [0]*10**6
for i in range(0, len(a)):
    for j in range(2, int(math.sqrt(a[i]))+1):
        if a[i] % j == 0:
            p[j] += 1
    if max(p)>1:
        f=1
        break
if f==0:
    print("pairwise coprime")
else:
    _gcd=a[0]
    for i  in range(1,len(a)):
        _gcd=math.gcd(_gcd,a[i])
    if _gcd==1:
        print("setwise coprime")
    else:
        print("not coprime")
    

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
M = max(a)+1
if M == 2:
    print("pairwise coprime")
    exit()
count = [0]*(M)
prime = [2,3,5,7,11,13]
for i in range(14,int(M**0.5)+2):
    check = True
    for j in prime:
        if i%j == 0:
            check = False
            break
    if check:
        prime.append(i)
 
for i in a:
    for j in prime:
        if i < j:
            break
        if i%j==0:
            while i%j == 0:
                i //= j
            count[j] += 1
    if i > 1:
        count[i] += 1
 
ans = max(count)
 
if ans == 1:
    print("pairwise coprime")
elif ans == n:
    print("not coprime")
else:
    print("setwise coprime")
# Original solution
def main():
    N = int(eval(input()))
    *A, = list(map(int, input().split()))

    B = [0] * (10 ** 6 + 1)
    for x in A:
        B[x] += 1

    setwise = False

    d = 2
    e = d
    cnt = 0
    while e <= 10 ** 6:
        if B[e]:
            cnt += B[e]
        e += d
    if cnt == N:
        print('not coprime')
        return
    elif cnt > 1:
        setwise = True

    d = 3
    while d <= 10 ** 6:
        e = d
        cnt = 0
        while e <= 10 ** 6:
            if B[e]:
                cnt += B[e]
            e += d
        if cnt == N:
            print('not coprime')
            return
        elif cnt > 1:
            setwise = True
        d += 2

    print(('setwise coprime' if setwise else 'pairwise coprime'))


if __name__ == '__main__':
    main()


# Optimized solution
class Sieve:
    """区間[2,n]の値を素因数分解する"""

    def __init__(self, n=1):
        primes = []
        f = [0] * (n + 1)
        f[0] = f[1] = -1
        for i in range(2, n + 1):  # 素数を探す
            if f[i]:
                continue
            primes.append(i)
            f[i] = i  # 素数には自身を代入
            for j in range(i * i, n + 1, i):  # 合成数に素因数を書き込む
                if not f[j]:
                    f[j] = i  # 最小の素因数を代入
        self.primes = primes
        self.f = f

    def is_prime(self, x) -> bool:  # 素数判定
        return self.f[x] == x

    def factor_list(self, x) -> list:  # 素因数分解の昇順リスト, [2,2,3,5,...]
        res = []
        while x != 1:
            res.append(self.f[x])
            x //= self.f[x]
        return res

    def factor(self, x) -> list:  # 素因数分解の頻度リスト, [[2,x],[3,y],[5,z],...]
        fl = self.factor_list(x)
        if not fl:
            return []
        res = [[fl[0], 0]]
        for p in fl:
            if res[-1][0] == p:
                res[-1][1] += 1
            else:
                res.append([p, 1])
        return res


def main():
    N = int(eval(input()))
    *A, = list(map(int, input().split()))

    B = [0] * (10 ** 6 + 1)
    for x in A:
        B[x] += 1

    setwise = False

    sv = Sieve(10 ** 6)
    for p in sv.primes:
        e = p
        cnt = 0
        while e <= 10 ** 6:
            if B[e]:
                cnt += B[e]
            e += p
        if cnt == N:
            print('not coprime')
            return
        elif cnt > 1:
            setwise = True

    print(('setwise coprime' if setwise else 'pairwise coprime'))


if __name__ == '__main__':
    main()
# Original solution
import sys

def enum_div(n):
    ir=int(n**(0.5))+1
    ret=[]
    for i in range(1,ir):
        if n%i == 0:
            ret.append(i)
            if (i!= 1) & (i*i != n):
                ret.append(n//i)
    return ret


import math

def get_primenumber(number):#エラトステネスの篩
    prime_list = []
    search_list = list(range(2,number+1))
    #search_listの先頭の値が√nの値を超えたら終了
    while search_list[0] <= math.sqrt(number):
      #search_listの先頭の値が√nの値を超えたら終了
      #search_listの先頭をprime_listに入れて、先頭をリストに追加して削除
        head_num = search_list.pop(0)
        prime_list.append(head_num)
        #head_numの倍数を除去
        search_list = [num for num in search_list if num % head_num != 0]
    #prime_listにsearch_listを結合
    prime_list.extend(search_list)
    return prime_list

#p=get_primenumber(79000)

n=int(eval(input()))
ap=list(map(int,input().split()))
amin=min(ap)
amax=max(ap)

if amax==1:
    print("pairwise coprime")
    sys.exit()

if amin!=1:
    bp=enum_div(amin)+[amin]
    bp=bp[1:]
    for bpi in bp:
        yn=""
        for ai in ap:
            if ai%bpi!=0:
                yn="coprime"
                break
        if yn=="":
            print("not coprime")
            sys.exit()

if n>=78500 :
    print("setwise coprime")
    sys.exit()

p=get_primenumber(amax)

aa=[0]*(amax+1)
for ai in ap:
    aa[ai]+=1
    
#for pp in range(2,amax+1):
for pp in p:
#    psum=0
#    for pi in range(pp,amax+1,pp):
#        psum+=aa[pi]
    psum=sum(aa[pp: :pp])
#    print("pp:",pp,psum)
    if psum>=2:
            print("setwise coprime")
            sys.exit()
## max_13.txt ... max_16.txt : "setwise coprime"
print("pairwise coprime")
   


# Optimized solution

import sys

def enum_div(n):
    ir=int(n**(0.5))+1
    ret=[]
    for i in range(1,ir):
        if n%i == 0:
            ret.append(i)
            if (i!= 1) & (i*i != n):
                ret.append(n//i)
    return ret

n=int(eval(input()))
ap=list(map(int,input().split()))
amin=min(ap)
amax=max(ap)

if amax==1:
    print("pairwise coprime")
    sys.exit()

if amin!=1:
    bp=enum_div(amin)+[amin]
    bp=bp[1:]
    for bpi in bp:
        yn=""
        for ai in ap:
            if ai%bpi!=0:
                yn="coprime"
                break
        if yn=="":
            print("not coprime")
            sys.exit()

if n>=78500 :
    print("setwise coprime")
    sys.exit()

aa=[0]*(amax+1)
for ai in ap:
    aa[ai]+=1
    
for pp in range(2,amax+1):
    psum=sum(aa[pp: :pp])
#    print("pp:",pp,psum)
    if psum>=2:
            print("setwise coprime")
            sys.exit()
## max_13.txt ... max_16.txt : "setwise coprime"
print("pairwise coprime")
# Original solution

import sys

def enum_div(n):
    ir=int(n**(0.5))+1
    ret=[]
    for i in range(1,ir):
        if n%i == 0:
            ret.append(i)
            if (i!= 1) & (i*i != n):
                ret.append(n//i)
    return ret

from collections import deque    
#    q = deque(l)
#    q.append(4) # 後ろから4を挿入, l=deque([0,1,2,3,4])
#    q.appendleft(5)#前から5を挿入, l=deque([5,0,1,2,3,4])
#    x = q.pop() #後ろの要素を取り出す, x=4, l=deque([5,0,1,2,3])
#    y = q.popleft() # 前の要素を取り出す, y=5, l = deque([0,1,2,3])

def get_primenumber(number):#エラトステネスの篩
    prime_list = []
#    search_list = deque(list(range(2,number+1)))
    search_list = list(range(2,number+1))
    #search_listの先頭の値が√nの値を超えたら終了
#    while search_list[0] <= math.sqrt(number):
    while search_list[0]**2 <= number:
      #search_listの先頭の値が√nの値を超えたら終了
      #search_listの先頭をprime_listに入れて、先頭をリストに追加して削除
#        head_num = search_list.popleft()
        head_num = search_list.pop(0)
        prime_list.append(head_num)
        #head_numの倍数を除去
#        search_list =deque( [num for num in search_list if num % head_num != 0])
        search_list =[num for num in search_list if num % head_num != 0]
    #prime_listにsearch_listを結合
    prime_list.extend(search_list)
    return prime_list

n=int(eval(input()))
ap=list(map(int,input().split()))
amin=min(ap)
amax=max(ap)

if amax==1:
    print("pairwise coprime")
    sys.exit()

if amin!=1:
    bp=enum_div(amin)+[amin]
    bp.sort()
    bp=bp[1:]
    for bpi in bp:
        yn=""
        for ai in ap:
            if ai%bpi!=0:
                yn="coprime"
                break
        if yn=="":
            print("not coprime")
            sys.exit()

if n>=78500 :
    print("setwise coprime")
    sys.exit()

aa=[0]*(amax+1)
for ai in ap:
    aa[ai]+=1

#p=get_primenumber(amax)

#for pp in p:
for pp in range(2,amax+1):
    psum=sum(aa[pp: :pp])
#    print("pp:",pp,psum)
    if psum>=2:
            print("setwise coprime")
            sys.exit()
## max_13.txt ... max_16.txt : "setwise coprime"
print("pairwise coprime")
   


# Optimized solution
import sys

def enum_div(n):
    ir=int(n**(0.5))+1
    ret=[]
    for i in range(1,ir):
        if n%i == 0:
            ret.append(i)
            if (i!= 1) & (i*i != n):
                ret.append(n//i)
    return ret

n=int(eval(input()))
ap=list(map(int,input().split()))
amin=min(ap)
amax=max(ap)

if amax==1:
    print("pairwise coprime")
    sys.exit()

if amin!=1:
    bp=enum_div(amin)+[amin]
#    bp.sort()
    bp=bp[1:]
    for bpi in bp:
        yn=""
        for ai in ap:
            if ai%bpi!=0:
                yn="coprime"
                break
        if yn=="":
            print("not coprime")
            sys.exit()

if n>=78500 :
    print("setwise coprime")
    sys.exit()

aa=[0]*(amax+1)
for ai in ap:
    aa[ai]+=1

#p=get_primenumber(amax)

#for pp in p:
for pp in range(2,amax+1):
    psum=sum(aa[pp: :pp])
#    print("pp:",pp,psum)
    if psum>=2:
            print("setwise coprime")
            sys.exit()
## max_13.txt ... max_16.txt : "setwise coprime"
print("pairwise coprime")
# Original solution
from functools import reduce
from math import gcd

N=int(eval(input()))
A=list(map(int, input().split()))
c=10**6+1
C=[0]*c
f=1
for i in A:
    C[i]+=1

for i in range(2,c):
    cnt=0
    for j in range(i,c,i):
        cnt+=C[j]
    if cnt>1:
        f=0


if f==1:
    print('pairwise coprime')

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')

# Optimized solution
from functools import reduce
from math import gcd

N=int(eval(input()))
A=list(map(int, input().split()))
c=max(A)+1
C=[0]*c
f=1
for i in A:
    C[i]+=1

for i in range(2,c):
    cnt=0
    for j in range(i,c,i):
        cnt+=C[j]
    if cnt>1:
        f=0


if f==1:
    print('pairwise coprime')

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')
# Original solution
from functools import reduce
from math import gcd

N=int(eval(input()))
A=list(map(int, input().split()))
c=max(A)+1
C=[0]*c
f=1
for i in A:
    C[i]+=1

for i in range(2,c):
    cnt=0
    for j in range(i,c,i):
        cnt+=C[j]
    if cnt>1:
        f=0


if f==1:
    print('pairwise coprime')

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')

# Optimized solution
from functools import reduce
from math import gcd

N=int(eval(input()))
A=list(map(int, input().split()))

c=max(A)+1
D=[0]*c
div=[0]*c
P=[]

for i in range(2,c):
    if D[i]==0:
        P.append(i)
        D[i]=i
    for j in P:
        if i*j>=c  or j>D[i] :
           break
        D[i*j]=j
f=0
for i in A:
    if i==1:
        continue
    temp=i
    while temp!=1:
        if div[D[temp]]==1:
            f=1
            break
        div[D[temp]]+=1
        temp2=D[temp]
        while temp%temp2==0 and temp>=temp2:
            temp=temp//temp2
    if f==1:
        break
        


if max(div)<=1 and f==0:
    print('pairwise coprime')

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')
# Original solution
import sys
from functools import reduce
from operator import add


def _i(): return int(sys.stdin.readline().strip())


def _ia(): return list(map(int, sys.stdin.readline().strip().split()))


def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    else:
        return gcd(b, r)


def main():
    n = _i()
    a = list(sorted(_ia()))
    r = a[0]
    for ai in a[1:]:
        r = gcd(r, ai)
        if r == 1:
            break
    else:
        return "not coprime"

    N = 10 ** 6 + 1
    f = [False] * N
    p = []
    k = {ai: [] for ai in a}
    for i in range(2, N):
        if f[i]:
            continue
        p.append(i)
        if k.get(i) is not None:
            k[i].append(i)
        for j in range(2*i, N, i):
            f[j] = True
            if k.get(j) is not None:
                k[j].append(i)

    ls = reduce(add, list(k.values()), [])
    if len(ls) != len(set(ls)):
        return "setwise coprime"
    else:
        return "pairwise coprime"


if __name__ == "__main__":
    print((main()))


# Optimized solution
import sys
from functools import reduce
from operator import add


def _i(): return int(sys.stdin.readline().strip())


def _ia(): return list(map(int, sys.stdin.readline().strip().split()))


def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    else:
        return gcd(b, r)


def main():
    n = _i()
    a = list(sorted(_ia()))
    r = a[0]
    for ai in a[1:]:
        r = gcd(r, ai)
        if r == 1:
            break
    else:
        return "not coprime"

    N = 10 ** 6 + 1
    f = [False] * N
    p = []
    k = {ai: 1 for ai in a}
    for i in range(2, N):
        if f[i]:
            continue
        p.append(i)

        tmp = 0
        if k.get(i) is not None:
            tmp += 1
        for j in range(2*i, N, i):
            f[j] = True
            if k.get(j) is not None:
                tmp += 1
                if tmp > 1:
                    return "setwise coprime"
    else:
        return "pairwise coprime"


if __name__ == "__main__":
    print((main()))
# Original solution
from math import sqrt, gcd
import sys


def osk_a(M):
    p = [i for i in range(M+1)]
    for x in range(2, int(sqrt(M))+1):
        if p[x] == x:
            for y in range(2*x, M+1, x):
                if p[y] == y:
                    p[y] = x
    return p


def g(a):
    g = 0
    for x in a:
        g = gcd(g, x)
    return g


def main():
    n = int(sys.stdin.buffer.readline())
    a = list(map(int, sys.stdin.buffer.readline().split()))
    if g(a) > 1:
        print("not coprime")
        exit()
    p = osk_a(10**6)
    chk = set()
    t = a[0]
    while t > 1:
        chk.add(p[t])
        t //= p[t]

    for x in a[1:]:
        tmp = set()
        while x > 1:
            tmp.add(p[x])
            x //= p[x]
        if len(chk & tmp):
            print("setwise coprime")
            exit()
        else:
            chk |= tmp
    print("pairwise coprime")


if __name__ == "__main__":
    main()


# Optimized solution
from math import sqrt, gcd
import sys


def osk_a(M):
    p = [i for i in range(M+1)]
    for x in range(2, int(sqrt(M))+1):
        if p[x] == x:
            for y in range(2*x, M+1, x):
                if p[y] == y:
                    p[y] = x
    return p


def g(a):
    g = 0
    for x in a:
        g = gcd(g, x)
    return g


def main():
    n = int(sys.stdin.buffer.readline())
    a = list(map(int, sys.stdin.buffer.readline().split()))
    if g(a) > 1:
        print("not coprime")
        exit()
    p = osk_a(10**6)
    chk = set()
    t = a[0]
    while t > 1:
        chk.add(p[t])
        t //= p[t]

    for x in a[1:]:
        tmp = set()
        while x > 1:
            tmp.add(p[x])
            x //= p[x]
        if chk.isdisjoint(tmp):
            chk |= tmp
        else:
            print("setwise coprime")
            exit()
    print("pairwise coprime")


if __name__ == "__main__":
    main()