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

sosu = [1 for _ in range(10**6+1)]
sosu[0] = 0
sosu[1] = 1
i = 2
while i < len(sosu):
    j = i*2
    if sosu[i] == 0:
        i += 1
        continue
    while j < len(sosu):
        sosu[j] = 0
        j += i
    i += 1
sosus = []
for i in range(2, len(sosu)):
    if sosu[i]:
        sosus.append(i)

sosuset = set()
flag = 0
GCD = a[0]
for i in range(n-1, -1, -1):
    J = 0
    j = sosus[J]
    GCD = math.gcd(GCD, a[i])
    while j*j <= a[i]:
        if a[i]%j == 0 and j in sosuset:
            flag = 1
            break
        while a[i]%j == 0:
            a[i]//=j
            sosuset.add(j)
        J += 1
        j = sosus[J]
    if a[i] != 1:
        sosuset.add(a[i])


if GCD == 1 and flag == 0:
    print("pairwise coprime")
elif GCD == 1 and flag == 1:
    print("setwise coprime")
else:
    print("not coprime")