from collections import defaultdict



def gcd(a, b):

    if a < b:

        return gcd(b, a)

    while b > 0:

        a, b = b, a % b

    return a



def sieve_of_eratosthenes_max(n):

    sieve = [0] * (n+1)

    sieve[0] = 0 #素数でない

    sieve[1] = 1 #素数でない

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

        if sieve[i] == 0:

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

                sieve[i * j] = i

    return sieve



def factorize_by_sieve_of_eratosthenes(x, sieve):

    factor = defaultdict(int)

    while sieve[x] != x:

        factor[sieve[x]] += 1

        x //= sieve[x]

    factor[x] += 1

    return factor



n = int(eval(input()))

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

a_list.sort()



sieve = sieve_of_eratosthenes_max(a_list[-1])

pairwise = True

setwise = True

primes = set()

x = a_list[0]

for a in a_list:

    x = gcd(x, a)

    if pairwise and a != 1:

        factor = set(factorize_by_sieve_of_eratosthenes(a, sieve).keys())

        if not primes.isdisjoint(factor):

            pairwise = False

        else:

            primes |= factor



if pairwise:

    print("pairwise coprime")

elif x == 1:

    print("setwise coprime")

else:

    print("not coprime")





from collections import defaultdict

import math



def gcd(a, b):

    if a < b:

        return gcd(b, a)

    while b > 0:

        a, b = b, a % b

    return a



def sieve_of_eratosthenes(n):

    sieve = list(range(n+1))

    sieve[0] = 1 #素数でない

    sieve[1] = 1 #素数でない

    m = int(math.sqrt(n))

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

        if sieve[i] < i:

            continue

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

            if sieve[j] == j:

                sieve[j] = i

    return sieve



def factorize_by_sieve(x, sieve):

    factor = defaultdict(int)

    while sieve[x] != x:

        factor[sieve[x]] += 1

        x //= sieve[x]

    factor[x] += 1

    return factor



n = int(eval(input()))

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

a_list.sort()



sieve = sieve_of_eratosthenes(a_list[-1])

pairwise = True

setwise = True

primes = set()

x = a_list[0]

for a in a_list:

    x = gcd(x, a)

    if pairwise and a != 1:

        factor = set(factorize_by_sieve(a, sieve).keys())

        if not primes.isdisjoint(factor):

            pairwise = False

        else:

            primes |= factor



if pairwise:

    print("pairwise coprime")

elif x == 1:

    print("setwise coprime")

else:

    print("not coprime")
from collections import defaultdict


def gcd(a, b):
    if a < b:
        return gcd(b, a)
    while b > 0:
        a, b = b, a % b
    return a


def sieve_of_eratosthenes_max(n):
    sieve = [0] * (n + 1)
    sieve[0] = 0  # 素数でない
    sieve[1] = 1  # 素数でない
    for i in range(2, n + 1):
        if sieve[i] == 0:
            for j in range(1, n // i + 1):
                sieve[i * j] = i
    return sieve


def factorize_by_sieve_of_eratosthenes(x, sieve):
    factor = defaultdict(int)
    while sieve[x] != x:
        factor[sieve[x]] += 1
        x //= sieve[x]
    factor[x] += 1
    return factor


n = int(eval(input()))
a_list = list(map(int, input().split()))
a_list.sort()
sieve = sieve_of_eratosthenes_max(a_list[-1])
pairwise = True
setwise = True
primes = set()
x = a_list[0]
for a in a_list:
    x = gcd(x, a)
    if pairwise and a != 1:
        factor = set(factorize_by_sieve_of_eratosthenes(a, sieve).keys())
        if not primes.isdisjoint(factor):
            pairwise = False
        else:
            primes |= factor
if pairwise:
    print("pairwise coprime")
elif x == 1:
    print("setwise coprime")
else:
    print("not coprime")

from collections import defaultdict
import math


def gcd(a, b):
    if a < b:
        return gcd(b, a)
    while b > 0:
        a, b = b, a % b
    return a


def sieve_of_eratosthenes(n):
    sieve = list(range(n + 1))
    sieve[0] = 1  # 素数でない
    sieve[1] = 1  # 素数でない
    m = int(math.sqrt(n))
    for i in range(2, m + 1):
        if sieve[i] < i:
            continue
        for j in range(i * i, n + 1, i):
            if sieve[j] == j:
                sieve[j] = i
    return sieve


def factorize_by_sieve(x, sieve):
    factor = defaultdict(int)
    while sieve[x] != x:
        factor[sieve[x]] += 1
        x //= sieve[x]
    factor[x] += 1
    return factor


n = int(eval(input()))
a_list = list(map(int, input().split()))
a_list.sort()
sieve = sieve_of_eratosthenes(a_list[-1])
pairwise = True
setwise = True
primes = set()
x = a_list[0]
for a in a_list:
    x = gcd(x, a)
    if pairwise and a != 1:
        factor = set(factorize_by_sieve(a, sieve).keys())
        if not primes.isdisjoint(factor):
            pairwise = False
        else:
            primes |= factor
if pairwise:
    print("pairwise coprime")
elif x == 1:
    print("setwise coprime")
else:
    print("not coprime")

+import math -def sieve_of_eratosthenes_max(n): -    sieve = [0] * (n + 1) -    sieve[0] = 0  # 素数でない +def sieve_of_eratosthenes(n): +    sieve = list(range(n + 1)) +    sieve[0] = 1  # 素数でない -    for i in range(2, n + 1): -        if sieve[i] == 0: -            for j in range(1, n // i + 1): -                sieve[i * j] = i +    m = int(math.sqrt(n)) +    for i in range(2, m + 1): +        if sieve[i] < i: +            continue +        for j in range(i * i, n + 1, i): +            if sieve[j] == j: +                sieve[j] = i -def factorize_by_sieve_of_eratosthenes(x, sieve): +def factorize_by_sieve(x, sieve): -sieve = sieve_of_eratosthenes_max(a_list[-1]) +sieve = sieve_of_eratosthenes(a_list[-1]) -        factor = set(factorize_by_sieve_of_eratosthenes(a, sieve).keys()) +        factor = set(factorize_by_sieve(a, sieve).keys())