N = int(eval(input()))

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

def p(n):

    """ """

    min_facts = [0] * (n+1)

    is_prime = [True] * (n+1)

    is_prime[0] = False

    is_prime[1] = False

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

        if not is_prime[i]:

            continue

        min_facts[i] = i

        

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

            is_prime[j] = False

            if min_facts[j] == 0:

                min_facts[j] = i

    return min_facts



min_facts = p(max(A))

fact_counts = dict()

for a in A:

    appeared = set()

    while min_facts[a] > 0:

        f = min_facts[a]

        if not f in appeared:

            fact_counts.setdefault(f, 0)

            fact_counts[f] += 1

            appeared.add(f)

        a //= f



pairwise = True

for c in list(fact_counts.values()):

    if c > 1:

        pairwise = False

        break



if pairwise:

    print('pairwise coprime')

else:

    if max(fact_counts.values()) == N:

        print('not coprime')

    else:

        print('setwise coprime')

n = int(eval(input()))

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

maxa = max(A)

cnt = [0] * (maxa + 1)

for a in A:

    cnt[a] += 1



from math import gcd

from functools import reduce

if reduce(gcd, A) != 1:

    print('not coprime')

else:

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

        if sum(cnt[i::i]) > 1:

            print('setwise coprime')

            break

    else:

        print('pairwise coprime')

N = int(eval(input()))
A = tuple(map(int, input().split()))


def p(n):
    """ """
    min_facts = [0] * (n + 1)
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n + 1):
        if not is_prime[i]:
            continue
        min_facts[i] = i
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
            if min_facts[j] == 0:
                min_facts[j] = i
    return min_facts


min_facts = p(max(A))
fact_counts = dict()
for a in A:
    appeared = set()
    while min_facts[a] > 0:
        f = min_facts[a]
        if not f in appeared:
            fact_counts.setdefault(f, 0)
            fact_counts[f] += 1
            appeared.add(f)
        a //= f
pairwise = True
for c in list(fact_counts.values()):
    if c > 1:
        pairwise = False
        break
if pairwise:
    print("pairwise coprime")
else:
    if max(fact_counts.values()) == N:
        print("not coprime")
    else:
        print("setwise coprime")

n = int(eval(input()))
A = tuple(map(int, input().split()))
maxa = max(A)
cnt = [0] * (maxa + 1)
for a in A:
    cnt[a] += 1
from math import gcd
from functools import reduce

if reduce(gcd, A) != 1:
    print("not coprime")
else:
    for i in range(2, maxa + 1):
        if sum(cnt[i::i]) > 1:
            print("setwise coprime")
            break
    else:
        print("pairwise coprime")

-N = int(eval(input())) +n = int(eval(input())) +maxa = max(A) +cnt = [0] * (maxa + 1) +for a in A: +    cnt[a] += 1 +from math import gcd +from functools import reduce - -def p(n): -    """ """ -    min_facts = [0] * (n + 1) -    is_prime = [True] * (n + 1) -    is_prime[0] = False -    is_prime[1] = False -    for i in range(2, n + 1): -        if not is_prime[i]: -            continue -        min_facts[i] = i -        for j in range(i * 2, n + 1, i): -            is_prime[j] = False -            if min_facts[j] == 0: -                min_facts[j] = i -    return min_facts - - -min_facts = p(max(A)) -fact_counts = dict() -for a in A: -    appeared = set() -    while min_facts[a] > 0: -        f = min_facts[a] -        if not f in appeared: -            fact_counts.setdefault(f, 0) -            fact_counts[f] += 1 -            appeared.add(f) -        a //= f -pairwise = True -for c in list(fact_counts.values()): -    if c > 1: -        pairwise = False -        break -if pairwise: -    print("pairwise coprime") +if reduce(gcd, A) != 1: +    print("not coprime") -    if max(fact_counts.values()) == N: -        print("not coprime") +    for i in range(2, maxa + 1): +        if sum(cnt[i::i]) > 1: +            print("setwise coprime") +            break -        print("setwise coprime") +        print("pairwise coprime")