from functools import reduce

from math import gcd 



n = int(eval(input()))

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



def furui(x):

    memo = [0]*(x+1)

    primes = []

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

        if memo[i]: continue

        primes.append(i)

        memo[i] = i

        for j in range(i*i, x+1, i):

            if memo[j]: continue

            memo[j] = i

    return memo, primes



memo, primes = furui(10**6+5)



pr = [True]*(10**6+5)

for a in A:

    if a == 1: continue

    while a != 1:

        w = memo[a]

        if not pr[w]:

            break

        pr[w] = False

        while a%w == 0:

            a = a // w

    else:

        continue

    break

else:

    print('pairwise coprime')

    exit()



if reduce(gcd, A) == 1:

    print('setwise coprime')

else:

    print('not coprime')

from math import gcd 



n = int(eval(input()))

maxA = 10**6+5

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

c = [0]*maxA

for a in A:

    c[a] += 1



for i in range(2, maxA):

    cnt = 0

    for j in range(i, maxA, i):

        cnt += c[j]

    if cnt >= 2:

        break

else:

    print('pairwise coprime')

    exit()



g = 0

for a in A:

    g = gcd(g, a)

if g == 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()))


def furui(x):
    memo = [0] * (x + 1)
    primes = []
    for i in range(2, x + 1):
        if memo[i]:
            continue
        primes.append(i)
        memo[i] = i
        for j in range(i * i, x + 1, i):
            if memo[j]:
                continue
            memo[j] = i
    return memo, primes


memo, primes = furui(10**6 + 5)
pr = [True] * (10**6 + 5)
for a in A:
    if a == 1:
        continue
    while a != 1:
        w = memo[a]
        if not pr[w]:
            break
        pr[w] = False
        while a % w == 0:
            a = a // w
    else:
        continue
    break
else:
    print("pairwise coprime")
    exit()
if reduce(gcd, A) == 1:
    print("setwise coprime")
else:
    print("not coprime")

from math import gcd

n = int(eval(input()))
maxA = 10**6 + 5
A = list(map(int, input().split()))
c = [0] * maxA
for a in A:
    c[a] += 1
for i in range(2, maxA):
    cnt = 0
    for j in range(i, maxA, i):
        cnt += c[j]
    if cnt >= 2:
        break
else:
    print("pairwise coprime")
    exit()
g = 0
for a in A:
    g = gcd(g, a)
if g == 1:
    print("setwise coprime")
else:
    print("not coprime")

-from functools import reduce +maxA = 10**6 + 5 - - -def furui(x): -    memo = [0] * (x + 1) -    primes = [] -    for i in range(2, x + 1): -        if memo[i]: -            continue -        primes.append(i) -        memo[i] = i -        for j in range(i * i, x + 1, i): -            if memo[j]: -                continue -            memo[j] = i -    return memo, primes - - -memo, primes = furui(10**6 + 5) -pr = [True] * (10**6 + 5) +c = [0] * maxA -    if a == 1: -        continue -    while a != 1: -        w = memo[a] -        if not pr[w]: -            break -        pr[w] = False -        while a % w == 0: -            a = a // w -    else: -        continue -    break +    c[a] += 1 +for i in range(2, maxA): +    cnt = 0 +    for j in range(i, maxA, i): +        cnt += c[j] +    if cnt >= 2: +        break -if reduce(gcd, A) == 1: +g = 0 +for a in A: +    g = gcd(g, a) +if g == 1: