import sys
input = sys.stdin.readline

def gcd(p,q):
# Create the gcd of two positive integers.
    while q != 0:
        p, q = q, p%q
    return p

def is_coprime(x, y):
    return gcd(x, y) == 1


N = int(input())
A = list(map(int,input().split()))
flag = False
cnt = 0
GCDArr = A[0]
for i in range(N):
    for j in range(i+1,N):
        if is_coprime(A[i],A[j]) == True:
            flag = True
        else:
            flag = False
if flag == True:
    print("pairwise coprime")
else:
    for i in range(N):
        GCDArr = gcd(GCDArr,A[i])
    if GCDArr == 1:
        print("setwise coprime")
        print(cnt)
    else:
        print("not coprime")