from collections import Counter

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

A.sort()
A_max = A[-1]


def prime_factorization(n):
    counter = Counter()

    if n < 2:
        return counter

    for i in range(2, int(n ** 0.5) + 1):
        if i * i > n:
            break

        while n % i == 0:
            counter[i] += 1
            n //= i

    if n > 1:
        counter[n] += 1

    return counter


used = set()
A_set = set(A)

pairwise = True
setwise = True

u = set()
flag = True
for a in A:
    counter = prime_factorization(a)

    if flag:
        u = set(counter.keys())
        flag = False
    else:
        u = u.intersection(counter.keys())

    if pairwise:
        for k in counter.keys():
            if k in used:
                continue

            v = k
            cnt = 1

            while v <= A_max:
                if v != a and v in A_set:
                    pairwise = False
                    break

                cnt += 1
                v = k * cnt

            if not pairwise:
                break

            used.add(k)


if pairwise:
    print('pairwise coprime')
elif not u:
    print('setwise coprime')
else:
    print('not coprime')
