from functools import reduce

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

def prime_factorize(n):
    res = []
    while n % 2 == 0:
        res.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            res.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        res.append(n)
    return res

def is_pairwise_coprime():
    s = set()
    for ai in a:
        p = set(prime_factorize(ai))
        ns = s | p
        if len(s) + len(p) != len(ns):
            return False
        s = ns
    return True

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

def is_setwise_coprime():
    return reduce(gcd, a) == 1


if is_pairwise_coprime():
    print('pairwise coprime')
elif is_setwise_coprime():
    print('setwise coprime')
else:
    print('not coprime')