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')
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')
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")

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")

-C = [0] * c -f = 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 -    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: +    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: