from math import gcd

N = int(eval(input()))

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



g = 0

for a in A:

    g = gcd(g,a)

if g > 1:

    print('not coprime')

    exit()



sa = set()

for a in A:

    if a==1: continue

    if a in sa:

        print('setwise coprime')

        exit()

    sa.add(a)



MAXN = 10**6+10

sieve = [0,0] + [1]*MAXN

p = 2

small_primes = []

while p*p <= MAXN:

    if sieve[p]:

        small_primes.append(p)

        for q in range(2*p,MAXN+1,p):

            sieve[q] = 0

    p += 1



st = set()

for a in A:

    for p in small_primes:

        found = False

        while a%p==0:

            a //= p

            found = True

        if found:

            if p in st:

                print('setwise coprime')

                exit()

            st.add(p)

        if a==1: break

    else:

        if a in st:

            print('setwise coprime')

            exit()

        st.add(a)



print('pairwise coprime')
from math import gcd

N = int(eval(input()))

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



g = 0

for a in A:

    g = gcd(g,a)

if g > 1:

    print('not coprime')

    exit()



MAXN = 10**6+10

sieve = [i for i in range(MAXN+1)]

p = 2

while p*p <= MAXN:

    if sieve[p] == p:

        for q in range(2*p,MAXN+1,p):

            if sieve[q] == q:

                sieve[q] = p

    p += 1



st = set()

for a in A:

    tmp = set()

    while a > 1:

        tmp.add(sieve[a])

        a //= sieve[a]

    for p in tmp:

        if p in st:

            print('setwise coprime')

            exit()

        st.add(p)

print('pairwise coprime')
from math import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
g = 0
for a in A:
    g = gcd(g, a)
if g > 1:
    print("not coprime")
    exit()
sa = set()
for a in A:
    if a == 1:
        continue
    if a in sa:
        print("setwise coprime")
        exit()
    sa.add(a)
MAXN = 10**6 + 10
sieve = [0, 0] + [1] * MAXN
p = 2
small_primes = []
while p * p <= MAXN:
    if sieve[p]:
        small_primes.append(p)
        for q in range(2 * p, MAXN + 1, p):
            sieve[q] = 0
    p += 1
st = set()
for a in A:
    for p in small_primes:
        found = False
        while a % p == 0:
            a //= p
            found = True
        if found:
            if p in st:
                print("setwise coprime")
                exit()
            st.add(p)
        if a == 1:
            break
    else:
        if a in st:
            print("setwise coprime")
            exit()
        st.add(a)
print("pairwise coprime")

from math import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
g = 0
for a in A:
    g = gcd(g, a)
if g > 1:
    print("not coprime")
    exit()
MAXN = 10**6 + 10
sieve = [i for i in range(MAXN + 1)]
p = 2
while p * p <= MAXN:
    if sieve[p] == p:
        for q in range(2 * p, MAXN + 1, p):
            if sieve[q] == q:
                sieve[q] = p
    p += 1
st = set()
for a in A:
    tmp = set()
    while a > 1:
        tmp.add(sieve[a])
        a //= sieve[a]
    for p in tmp:
        if p in st:
            print("setwise coprime")
            exit()
        st.add(p)
print("pairwise coprime")

-sa = set() -for a in A: -    if a == 1: -        continue -    if a in sa: -        print("setwise coprime") -        exit() -    sa.add(a) -sieve = [0, 0] + [1] * MAXN +sieve = [i for i in range(MAXN + 1)] -small_primes = [] -    if sieve[p]: -        small_primes.append(p) +    if sieve[p] == p: -            sieve[q] = 0 +            if sieve[q] == q: +                sieve[q] = p -    for p in small_primes: -        found = False -        while a % p == 0: -            a //= p -            found = True -        if found: -            if p in st: -                print("setwise coprime") -                exit() -            st.add(p) -        if a == 1: -            break -    else: -        if a in st: +    tmp = set() +    while a > 1: +        tmp.add(sieve[a]) +        a //= sieve[a] +    for p in tmp: +        if p in st: -        st.add(a) +        st.add(p)