import numpy as np

from numba import njit





n = int(eval(input()))

arr = np.array(list(map(int, input().split())))





n = 10**6 + 1

primes = set(range(3, n+1, 2))



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

    primes.difference_update(list(range(i*2, n+1, i)))

primes.add(2)





@njit

def solve(arr, primes):

    cnt = np.bincount(arr)

    for p in primes:

        if (cnt[p::p]).sum() > 1:

            return False

    else:

        return True





if np.gcd.reduce(arr) != 1:

    print("not coprime")

elif solve(arr, primes):

    print("pairwise coprime")

else:

    print("setwise coprime")
import numpy as np

from numba import njit





n = int(eval(input()))

arr = np.array(list(map(int, input().split())))





@njit

def solve(arr):

    cnt = np.bincount(arr)

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

        if (cnt[i::i]).sum() > 1:

            return False

    else:

        return True





if np.gcd.reduce(arr) != 1:

    print("not coprime")

elif solve(arr):

    print("pairwise coprime")

else:

    print("setwise coprime")
import numpy as np
from numba import njit

n = int(eval(input()))
arr = np.array(list(map(int, input().split())))
n = 10**6 + 1
primes = set(range(3, n + 1, 2))
for i in range(3, int(n**0.5 + 1)):
    primes.difference_update(list(range(i * 2, n + 1, i)))
primes.add(2)


@njit
def solve(arr, primes):
    cnt = np.bincount(arr)
    for p in primes:
        if (cnt[p::p]).sum() > 1:
            return False
    else:
        return True


if np.gcd.reduce(arr) != 1:
    print("not coprime")
elif solve(arr, primes):
    print("pairwise coprime")
else:
    print("setwise coprime")

import numpy as np
from numba import njit

n = int(eval(input()))
arr = np.array(list(map(int, input().split())))


@njit
def solve(arr):
    cnt = np.bincount(arr)
    for i in range(2, 10**6 + 1):
        if (cnt[i::i]).sum() > 1:
            return False
    else:
        return True


if np.gcd.reduce(arr) != 1:
    print("not coprime")
elif solve(arr):
    print("pairwise coprime")
else:
    print("setwise coprime")

-n = 10**6 + 1 -primes = set(range(3, n + 1, 2)) -for i in range(3, int(n**0.5 + 1)): -    primes.difference_update(list(range(i * 2, n + 1, i))) -primes.add(2) -def solve(arr, primes): +def solve(arr): -    for p in primes: -        if (cnt[p::p]).sum() > 1: +    for i in range(2, 10**6 + 1): +        if (cnt[i::i]).sum() > 1: -elif solve(arr, primes): +elif solve(arr):