from functools import reduce
def gen_d_prim(n):

    D = [0] * (n+1)

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

        if D[i] > 0: continue

        for j in range(i, n+1, i): D[j] = i

    return D



def is_pairwise(A):

    D = gen_d_prim(10**6)

    past = set()

    for a in A:

        now = set()

        while a != 1:

            # 素数 D[a]: 今回は未済 & 過去で済

            if not D[a] in now and D[a] in past: return False

            now.add(D[a])

            past.add(D[a])

            a //= D[a]

    return True



def solve():

    from functools import reduce

    from math import gcd

    if is_pairwise(A): return 0

    if reduce(gcd, A) == 1: return 1

    return 2



n = int(eval(input()))

A = [*list(map(int, input().split()))]

print((['pairwise','setwise','not'][solve()], 'coprime'))

from functools import reduce
def is_pairwise():

    MAX_A = 10**6 + 1

    C = [0] * MAX_A

    for a in A: C[a] += 1

    if sum(C[2::2]) > 1: return False

    for i in range(3, MAX_A, 2):

        if sum(C[i::i]) > 1: return False

    return True



def solve():

    from functools import reduce

    from math import gcd

    if is_pairwise(): return 0

    if reduce(gcd, A) == 1: return 1

    return 2



n = int(eval(input()))

A = [*list(map(int, input().split()))]

print((['pairwise','setwise','not'][solve()], 'coprime'))

from functools import reduce


def gen_d_prim(n):
    D = [0] * (n + 1)
    for i in range(2, n + 1):
        if D[i] > 0:
            continue
        for j in range(i, n + 1, i):
            D[j] = i
    return D


def is_pairwise(A):
    D = gen_d_prim(10**6)
    past = set()
    for a in A:
        now = set()
        while a != 1:
            # 素数 D[a]: 今回は未済 & 過去で済
            if not D[a] in now and D[a] in past:
                return False
            now.add(D[a])
            past.add(D[a])
            a //= D[a]
    return True


def solve():
    from functools import reduce
    from math import gcd

    if is_pairwise(A):
        return 0
    if reduce(gcd, A) == 1:
        return 1
    return 2


n = int(eval(input()))
A = [*list(map(int, input().split()))]
print((["pairwise", "setwise", "not"][solve()], "coprime"))

from functools import reduce


def is_pairwise():
    MAX_A = 10**6 + 1
    C = [0] * MAX_A
    for a in A:
        C[a] += 1
    if sum(C[2::2]) > 1:
        return False
    for i in range(3, MAX_A, 2):
        if sum(C[i::i]) > 1:
            return False
    return True


def solve():
    from functools import reduce
    from math import gcd

    if is_pairwise():
        return 0
    if reduce(gcd, A) == 1:
        return 1
    return 2


n = int(eval(input()))
A = [*list(map(int, input().split()))]
print((["pairwise", "setwise", "not"][solve()], "coprime"))

-def gen_d_prim(n): -    D = [0] * (n + 1) -    for i in range(2, n + 1): -        if D[i] > 0: -            continue -        for j in range(i, n + 1, i): -            D[j] = i -    return D - - -def is_pairwise(A): -    D = gen_d_prim(10**6) -    past = set() +def is_pairwise(): +    MAX_A = 10**6 + 1 +    C = [0] * MAX_A -        now = set() -        while a != 1: -            # 素数 D[a]: 今回は未済 & 過去で済 -            if not D[a] in now and D[a] in past: -                return False -            now.add(D[a]) -            past.add(D[a]) -            a //= D[a] +        C[a] += 1 +    if sum(C[2::2]) > 1: +        return False +    for i in range(3, MAX_A, 2): +        if sum(C[i::i]) > 1: +            return False -    if is_pairwise(A): +    if is_pairwise():