from functools import reduce

from itertools import combinations

from math import gcd





def func(A):

    n = len(A) - len(set(A))

    if n > 0 and n+1 != A.count(1):

        return False

    is_A = [False] * (10**6+1)

    for a in A:

        is_A[a] = True

    n = 0

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

        if is_A[i]:

            n += 1

    if n > 1:

        return False

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

        n = 0

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

            if is_A[j]:

                n += 1

        if n > 1:

            return False

    return True





def solve():

    N = int(eval(input()))

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

    if func(A):

        # if not all(gcd(i, j)==1 for i, j in combinations(A, 2)):

        #     raise NameError

        print('pairwise coprime')

    elif reduce(gcd, A) == 1:

        print('setwise coprime')

    else:

        print('not coprime')

    



if __name__ == '__main__':

    solve()
from functools import reduce

from itertools import combinations

from math import gcd





def func(A):

    is_A = [0] * (10**6+1)

    for a in A:

        is_A[a] += 1

    if any(x > 1 for x in is_A[2:]):

        return False

    n = 0

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

        if is_A[i]:

            n += 1

    if n > 1:

        return False

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

        n = 0

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

            if is_A[j]:

                n += 1

        if n > 1:

            return False

    return True





def solve():

    N = int(eval(input()))

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

    if func(A):

        # if not all(gcd(i, j)==1 for i, j in combinations(A, 2)):

        #     raise NameError

        print('pairwise coprime')

    elif reduce(gcd, A) == 1:

        print('setwise coprime')

    else:

        print('not coprime')

    



if __name__ == '__main__':

    solve()
from functools import reduce
from itertools import combinations
from math import gcd


def func(A):
    n = len(A) - len(set(A))
    if n > 0 and n + 1 != A.count(1):
        return False
    is_A = [False] * (10**6 + 1)
    for a in A:
        is_A[a] = True
    n = 0
    for i in range(2, 10**6 + 1, 2):
        if is_A[i]:
            n += 1
    if n > 1:
        return False
    for i in range(3, 10**6 + 1, 2):
        n = 0
        for j in range(i, 10**6 + 1, i):
            if is_A[j]:
                n += 1
        if n > 1:
            return False
    return True


def solve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    if func(A):
        # if not all(gcd(i, j)==1 for i, j in combinations(A, 2)):
        #     raise NameError
        print("pairwise coprime")
    elif reduce(gcd, A) == 1:
        print("setwise coprime")
    else:
        print("not coprime")


if __name__ == "__main__":
    solve()

from functools import reduce
from itertools import combinations
from math import gcd


def func(A):
    is_A = [0] * (10**6 + 1)
    for a in A:
        is_A[a] += 1
    if any(x > 1 for x in is_A[2:]):
        return False
    n = 0
    for i in range(2, 10**6 + 1, 2):
        if is_A[i]:
            n += 1
    if n > 1:
        return False
    for i in range(3, 10**6 + 1, 2):
        n = 0
        for j in range(i, 10**6 + 1, i):
            if is_A[j]:
                n += 1
        if n > 1:
            return False
    return True


def solve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    if func(A):
        # if not all(gcd(i, j)==1 for i, j in combinations(A, 2)):
        #     raise NameError
        print("pairwise coprime")
    elif reduce(gcd, A) == 1:
        print("setwise coprime")
    else:
        print("not coprime")


if __name__ == "__main__":
    solve()

-    n = len(A) - len(set(A)) -    if n > 0 and n + 1 != A.count(1): +    is_A = [0] * (10**6 + 1) +    for a in A: +        is_A[a] += 1 +    if any(x > 1 for x in is_A[2:]): -    is_A = [False] * (10**6 + 1) -    for a in A: -        is_A[a] = True