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

def prime(x):
    rtn = set()
    i = 2
    while i <= x:
        if (x % i == 0):
            rtn.add(i)
            while (x % i == 0):
                x /= i
        i += 1
    return rtn

is_pairwise = True
is_setwise = True

t = set()
s0 = set()
for s in (prime(i) for i in a):
    #print(s)
    if len(t & s) > 0:
        is_setwise = False
    if len(s0 & s) > 0:
        is_pairwise = False
    t |= s
    s0 = s

if is_pairwise:
    print("pairwise coprime")
elif is_setwise:
    print("setwise coprime")
else:
    print("not coprime")
