#「全ての 1≤i<j≤N について、GCD(Ai,Aj)=1」が成り立つ
#pairwise coprime
#pairwise coprime ではなく、かつ、GCD(A1,…,AN)=1 
#setwise coprime
#それ以外
#not coprime
import math
from collections import Counter

def prime_factorize(n):
    i = 2
    factors = []
    while i*i <= n:
        while n%i == 0:
            n //= i
            factors.append(i)
        i += 1
    if n > 1:
        factors.append(n)
    return Counter(factors)

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

c = []
for i in a:
    c.append(prime_factorize(i))

flg = True
gcd = a[0]
prime_factors = c[0]
for factors, A in zip(c[1:], a[1:]):
    if prime_factors & factors:
        flg = False
    prime_factors |= factors
    gcd = math.gcd(gcd, A)
    
if flg:
    print('pairwise coprime')    
elif gcd == 1:
    print('setwise coprime')
else:
    print('not coprime')