from sys import exit



def eratosthenes(n):

    '''

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

    O(NloglogN)

    '''

    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



    return [i for i in range(n+1) if is_prime[i]]





def factorization(n):

    '''

    素因数分解

    O(√N)

    '''

    res = []

    m = 2

    while m ** 2 <= n:

        if n % m == 0:

            cnt = 0

            while n % m == 0:

                cnt += 1

                n //= m

            res.append([m, cnt])

        m += 1



    if n > 1:

        res.append([n, 1])



    return res





n = int(eval(input()))

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



is_prime = [True] * (10**6+1)

is_prime[0] = False

is_prime[1] = False

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

l1 = eratosthenes(10**6)



flag1 = True

for v1 in a:

    for v2 in l1:

        if is_prime[v1]:

            if judge[v1]:

                flag1 = False

            else:

                judge[v1] = True

            break



        if v1 % v2 == 0:

            if judge[v2]:

                flag1 = False

            else:

                judge[v2] = True

            

            while v1 % v2 == 0:

                v1 //= v2

        

        if v1 == 1:

            break

        

if flag1:

    print('pairwise coprime')

    exit()



l2 = factorization(a[0])

for i, j in l2:

    flag2 = True

    for v in a:

        if v % i != 0:

            flag2 = False

            break

    if flag2:

        print('not coprime')

        exit()



print('setwise 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


def eratosthenes(n):
    """
    n以下の整数の素数判定/列挙 (n > 1)
    O(NloglogN)
    """
    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
    return [i for i in range(n + 1) if is_prime[i]]


def factorization(n):
    """
    素因数分解
    O(√N)
    """
    res = []
    m = 2
    while m**2 <= n:
        if n % m == 0:
            cnt = 0
            while n % m == 0:
                cnt += 1
                n //= m
            res.append([m, cnt])
        m += 1
    if n > 1:
        res.append([n, 1])
    return res


n = int(eval(input()))
a = list(map(int, input().split()))
is_prime = [True] * (10**6 + 1)
is_prime[0] = False
is_prime[1] = False
judge = [False] * (10**6 + 1)
l1 = eratosthenes(10**6)
flag1 = True
for v1 in a:
    for v2 in l1:
        if is_prime[v1]:
            if judge[v1]:
                flag1 = False
            else:
                judge[v1] = True
            break
        if v1 % v2 == 0:
            if judge[v2]:
                flag1 = False
            else:
                judge[v2] = True
            while v1 % v2 == 0:
                v1 //= v2
        if v1 == 1:
            break
if flag1:
    print("pairwise coprime")
    exit()
l2 = factorization(a[0])
for i, j in l2:
    flag2 = True
    for v in a:
        if v % i != 0:
            flag2 = False
            break
    if flag2:
        print("not coprime")
        exit()
print("setwise 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 math import gcd +    is_prime = [True] * (n + 1) +    is_prime[0] = False +    is_prime[1] = False +    judge = [i for i in range(n + 1)] -    return [i for i in range(n + 1) if is_prime[i]] - - -def factorization(n): -    """ -    素因数分解 -    O(√N) -    """ -    res = [] -    m = 2 -    while m**2 <= n: -        if n % m == 0: -            cnt = 0 -            while n % m == 0: -                cnt += 1 -                n //= m -            res.append([m, cnt]) -        m += 1 -    if n > 1: -        res.append([n, 1]) -    return res +                judge[j] = i +    return judge -is_prime = [True] * (10**6 + 1) -is_prime[0] = False -is_prime[1] = False -judge = [False] * (10**6 + 1) -l1 = eratosthenes(10**6) -flag1 = True -for v1 in a: -    for v2 in l1: -        if is_prime[v1]: -            if judge[v1]: -                flag1 = False -            else: -                judge[v1] = True -            break -        if v1 % v2 == 0: -            if judge[v2]: -                flag1 = False -            else: -                judge[v2] = True -            while v1 % v2 == 0: -                v1 //= v2 -        if v1 == 1: -            break -if flag1: +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: -l2 = factorization(a[0]) -for i, j in l2: -    flag2 = True -    for v in a: -        if v % i != 0: -            flag2 = False -            break -    if flag2: -        print("not coprime") -        exit() -print("setwise coprime") +g = a[0] +for v in a: +    g = gcd(g, v) +print(("setwise coprime" if g == 1 else "not coprime"))