# E - Coprime

from math import gcd



N = int(eval(input()))

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

A = sorted(A)

MAX = 10**6

L = [0]*(MAX+1)



def prime(x):

    global L

    p = 2

    while x>1:

        if L[x]==1:

            return False

        if x%p==0:

            while x%p==0:

                x //= p

            tmp = p

            while tmp<=MAX:

                L[tmp] = 1

                tmp += p

        p = p+1 if p*p<x else x   

    return True

        

G = A[0]

pairwise = True

_ = prime(A[0])



for i in range(1,N):

    a = A[i]

    if pairwise:

        pairwise = prime(a)

    G = gcd(G,a)



if pairwise:

    print('pairwise coprime')

elif G==1:

    print('setwise coprime')

else:

    print('not coprime')
# E - Coprime

from math import gcd



N = int(eval(input()))

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

MAX = 10**6

p = [0]*(MAX+1)



for i in range(2,MAX+1):

    if p[i]>0:

        continue

    tmp = i

    while tmp<=MAX:

        p[tmp] = i

        tmp += i



pairwise = True

g = -1

q = [-1]*(MAX+1)



for i in range(N):

    a = A[i]

    g = a if g<0 else gcd(g,a)

    while pairwise and a>1:

        pairwise = True if q[p[a]] in [-1,i] else False

        q[p[a]] = i

        a //= p[a]



if pairwise:

    print('pairwise coprime')

elif g==1:

    print('setwise coprime')

else:

    print('not coprime')
# E - Coprime
from math import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
A = sorted(A)
MAX = 10**6
L = [0] * (MAX + 1)


def prime(x):
    global L
    p = 2
    while x > 1:
        if L[x] == 1:
            return False
        if x % p == 0:
            while x % p == 0:
                x //= p
            tmp = p
            while tmp <= MAX:
                L[tmp] = 1
                tmp += p
        p = p + 1 if p * p < x else x
    return True


G = A[0]
pairwise = True
_ = prime(A[0])
for i in range(1, N):
    a = A[i]
    if pairwise:
        pairwise = prime(a)
    G = gcd(G, a)
if pairwise:
    print("pairwise coprime")
elif G == 1:
    print("setwise coprime")
else:
    print("not coprime")

# E - Coprime
from math import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
MAX = 10**6
p = [0] * (MAX + 1)
for i in range(2, MAX + 1):
    if p[i] > 0:
        continue
    tmp = i
    while tmp <= MAX:
        p[tmp] = i
        tmp += i
pairwise = True
g = -1
q = [-1] * (MAX + 1)
for i in range(N):
    a = A[i]
    g = a if g < 0 else gcd(g, a)
    while pairwise and a > 1:
        pairwise = True if q[p[a]] in [-1, i] else False
        q[p[a]] = i
        a //= p[a]
if pairwise:
    print("pairwise coprime")
elif g == 1:
    print("setwise coprime")
else:
    print("not coprime")

-A = sorted(A) -L = [0] * (MAX + 1) - - -def prime(x): -    global L -    p = 2 -    while x > 1: -        if L[x] == 1: -            return False -        if x % p == 0: -            while x % p == 0: -                x //= p -            tmp = p -            while tmp <= MAX: -                L[tmp] = 1 -                tmp += p -        p = p + 1 if p * p < x else x -    return True - - -G = A[0] +p = [0] * (MAX + 1) +for i in range(2, MAX + 1): +    if p[i] > 0: +        continue +    tmp = i +    while tmp <= MAX: +        p[tmp] = i +        tmp += i -_ = prime(A[0]) -for i in range(1, N): +g = -1 +q = [-1] * (MAX + 1) +for i in range(N): -    if pairwise: -        pairwise = prime(a) -    G = gcd(G, a) +    g = a if g < 0 else gcd(g, a) +    while pairwise and a > 1: +        pairwise = True if q[p[a]] in [-1, i] else False +        q[p[a]] = i +        a //= p[a] -elif G == 1: +elif g == 1: