from sys import exit

from math import gcd



def eratosthenes(n):

    '''

    n以下の整数の素数判定/列挙 (n > 1)

    O(NloglogN)

    '''

    is_prime = [True] * (n+1)

    is_prime[0] = False

    is_prime[1] = False

    judge = [i for i in range(n+1)]

    

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

        if is_prime[i]:

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

                is_prime[j] = False

                judge[j] = i



    return judge





n = int(eval(input()))

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



l = eratosthenes(10**6+1)



flag = True

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

for v in a:

    while v > 1:

        d = l[v]



        if used[d]:

            flag = False

        else:

            used[d] = True

        

        while v % d == 0:

            v //= d



if flag:

    print('pairwise coprime')

    exit()



g = a[0]

for v in a:

    g = gcd(g, v)



print(('setwise coprime' if g == 1 else 'not coprime'))
from sys import exit

from math import gcd



def eratosthenes(n):

    '''

    n以下の整数の素数判定/列挙 (n > 1)

    O(NloglogN)

    '''

    is_prime = [True] * (n+1)

    is_prime[0] = False

    is_prime[1] = False

    min_factor = [-1] * (n+1)

    min_factor[0] = 0

    min_factor[1] = 1

    

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

        if is_prime[i]:

            min_factor[i] = i

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

                is_prime[j] = False

                if min_factor[j] == -1:

                    min_factor[j] = i



    return min_factor





n = int(eval(input()))

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



l = eratosthenes(10**6+1)



flag = True

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

for v in a:

    s = set()

    while v > 1:

        if l[v] not in s:

            if used[l[v]]:

                flag = False

                break

            else:

                s.add(l[v])

                used[l[v]] = True

        

        v //= l[v]



if flag:

    print('pairwise coprime')

    exit()



g = 0

for v in a:

    g = gcd(g, v)



print(('setwise coprime' if g == 1 else 'not coprime'))
from sys import exit
from math import gcd


def eratosthenes(n):
    """
    n以下の整数の素数判定/列挙 (n > 1)
    O(NloglogN)
    """
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    judge = [i for i in range(n + 1)]
    for i in range(2, int(n**0.5) + 1):
        if is_prime[i]:
            for j in range(i * 2, n + 1, i):
                is_prime[j] = False
                judge[j] = i
    return judge


n = int(eval(input()))
a = list(map(int, input().split()))
l = eratosthenes(10**6 + 1)
flag = True
used = [False] * (10**6 + 1)
for v in a:
    while v > 1:
        d = l[v]
        if used[d]:
            flag = False
        else:
            used[d] = True
        while v % d == 0:
            v //= d
if flag:
    print("pairwise coprime")
    exit()
g = a[0]
for v in a:
    g = gcd(g, v)
print(("setwise coprime" if g == 1 else "not coprime"))

from sys import exit
from math import gcd


def eratosthenes(n):
    """
    n以下の整数の素数判定/列挙 (n > 1)
    O(NloglogN)
    """
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    min_factor = [-1] * (n + 1)
    min_factor[0] = 0
    min_factor[1] = 1
    for i in range(2, n + 1):
        if is_prime[i]:
            min_factor[i] = i
            for j in range(i * 2, n + 1, i):
                is_prime[j] = False
                if min_factor[j] == -1:
                    min_factor[j] = i
    return min_factor


n = int(eval(input()))
a = list(map(int, input().split()))
l = eratosthenes(10**6 + 1)
flag = True
used = [False] * (10**6 + 1)
for v in a:
    s = set()
    while v > 1:
        if l[v] not in s:
            if used[l[v]]:
                flag = False
                break
            else:
                s.add(l[v])
                used[l[v]] = True
        v //= l[v]
if flag:
    print("pairwise coprime")
    exit()
g = 0
for v in a:
    g = gcd(g, v)
print(("setwise coprime" if g == 1 else "not coprime"))

-    judge = [i for i in range(n + 1)] -    for i in range(2, int(n**0.5) + 1): +    min_factor = [-1] * (n + 1) +    min_factor[0] = 0 +    min_factor[1] = 1 +    for i in range(2, n + 1): +            min_factor[i] = i -                judge[j] = i -    return judge +                if min_factor[j] == -1: +                    min_factor[j] = i +    return min_factor +    s = set() -        d = l[v] -        if used[d]: -            flag = False -        else: -            used[d] = True -        while v % d == 0: -            v //= d +        if l[v] not in s: +            if used[l[v]]: +                flag = False +                break +            else: +                s.add(l[v]) +                used[l[v]] = True +        v //= l[v] -g = a[0] +g = 0