n,a=int(eval(input())),list(map(int,input().split()))

g=0

from math import gcd

for i in a:g=gcd(i,g)

if g!=1:print("not coprime")

else:

    from collections import defaultdict

    memo=defaultdict(int)

    for i in a:

        for p in range(2,int(i**.5)+1):

            if i%p==0:

                while i%p==0:i//=p

                if memo[p]:

                    print("setwise coprime");exit()

                memo[p]+=1

        if i!=1:

            if memo[i]:print("setwise coprime");exit()

            memo[i]+=1

    print("pairwise coprime")
n,a=int(eval(input())),list(map(int,input().split()))

g=0

from math import gcd

for i in a:g=gcd(i,g)

if g!=1:print("not coprime")

else:



    primes=list(range(10**6+1))

    primes[0]=primes[1]=0

    for i in range(2,10**6+1):

        if primes[i]==i:

            for j in range(2*i,10**6,i):primes[j]=i

    ps=set()

    for x in a:

        while x !=1:

            t=primes[x]

            if t in ps:print("setwise coprime");exit()

            ps.add(t)

            while x%t==0:x//=t

    print("pairwise coprime")
n, a = int(eval(input())), list(map(int, input().split()))
g = 0
from math import gcd

for i in a:
    g = gcd(i, g)
if g != 1:
    print("not coprime")
else:
    from collections import defaultdict

    memo = defaultdict(int)
    for i in a:
        for p in range(2, int(i**0.5) + 1):
            if i % p == 0:
                while i % p == 0:
                    i //= p
                if memo[p]:
                    print("setwise coprime")
                    exit()
                memo[p] += 1
        if i != 1:
            if memo[i]:
                print("setwise coprime")
                exit()
            memo[i] += 1
    print("pairwise coprime")

n, a = int(eval(input())), list(map(int, input().split()))
g = 0
from math import gcd

for i in a:
    g = gcd(i, g)
if g != 1:
    print("not coprime")
else:
    primes = list(range(10**6 + 1))
    primes[0] = primes[1] = 0
    for i in range(2, 10**6 + 1):
        if primes[i] == i:
            for j in range(2 * i, 10**6, i):
                primes[j] = i
    ps = set()
    for x in a:
        while x != 1:
            t = primes[x]
            if t in ps:
                print("setwise coprime")
                exit()
            ps.add(t)
            while x % t == 0:
                x //= t
    print("pairwise coprime")

-    from collections import defaultdict - -    memo = defaultdict(int) -    for i in a: -        for p in range(2, int(i**0.5) + 1): -            if i % p == 0: -                while i % p == 0: -                    i //= p -                if memo[p]: -                    print("setwise coprime") -                    exit() -                memo[p] += 1 -        if i != 1: -            if memo[i]: +    primes = list(range(10**6 + 1)) +    primes[0] = primes[1] = 0 +    for i in range(2, 10**6 + 1): +        if primes[i] == i: +            for j in range(2 * i, 10**6, i): +                primes[j] = i +    ps = set() +    for x in a: +        while x != 1: +            t = primes[x] +            if t in ps: -            memo[i] += 1 +            ps.add(t) +            while x % t == 0: +                x //= t