from math import gcd
least_prime = [0]*(10000009)
def leastPrimeFactor() : 
    n = 1000009
    least_prime[1] = 1
    for i in range(2, n + 1) : 
        if (least_prime[i] == 0) : 
            least_prime[i] = i 
            for j in range(2 * i, n + 1, i) : 
                if (least_prime[j] == 0) : 
                    least_prime[j] = i 
leastPrimeFactor()
n = input()
s = input().split(" ")
uniq = set()

for c in s:
    uniq.add(least_prime[int(c)])
if len(uniq) == len(s):
    print("pairwise coprime")
else:
    ans = 0
    for c in uniq:
        ans  = gcd(ans, c)
    if ans ==1:
        print("setwise coprime")
    else:
        print("not coprime")