from random import randint

def miller_rabin(n, rep=100): #random.randint
    if n == 2: return True
    if n == 1 or n % 2 == 0: return False
    d = (n - 1) // 2
    while d % 2 == 0:
        d //= 2
    for k in range(rep):
        a = randint(1, n - 1)
        t = d
        y = pow(a, t, n)
        while t != n - 1 and y != 1 and y != n - 1:
            y = (y * y) % n
            t *= 2
        if y != n - 1 and t % 2 == 0:
            return False
    return True

def factorize(n):
    if n == 1: return []
    res = []
    x, y = n, 2
    while y * y <= x:
        while x % y == 0:
            res.append(y)
            x //= y
        y += 1
    if x > 1:
        res.append(x)
    return res

def pollard_rho(n): #gcd, factorize, miller_rabin
    res = []
    stack = [n]
    while stack:
        tmp = stack.pop()
        if tmp < 10**3:
            res.extend(factorize(tmp))
            continue
        if miller_rabin(tmp):
            res.append(tmp)
            continue
        seed = 1
        while True:
            x, y, d = 2, 2, 1
            f = lambda x: (x**2 + seed) % tmp
            while d == 1:
                x = f(x)
                y = f(f(y))
                d = gcd(abs(x - y), tmp)
            if d != n:
                break
            seed += 1
        stack.append(d)
        stack.append(tmp // d)
    return sorted(res)

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

from collections import Counter, defaultdict

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

D = set()

flag = True
for i in range(N):
    if A[i] == 1:
        continue
    C = set(pollard_rho(A[i]))
    for k in C:
        if k in D:
            flag = False
            break
        else:
            C.add(k)

if flag:
    print('pairwise coprime')

else:
    res = 0
    for i in range(N):
        res = fcd(res, A[i])
    if res == 1:
        print('setwise coprime')
    else:
        print('not coprime')