from fractions import gcd
import sys
input = lambda : sys.stdin.readline().rstrip()

n = int(input())
As = map(int, input().split(" "))

is_set = False
out_min = 10**6+1

first = True
A0 = As[0]

def fctr1(n): 
    f=[]
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        if n%i==0:
            c+=1
            n=n//i
        if c!=0:
            f.append([i,c])
            c=0
    if n!=1:
        f.append([n,1])
    return f


for i in range(1, n):
    if i == 1:
        g = gcd(A0, As[i])
    else:
        g = gcd(g, As[i])

    if g == 1:
        is_set = True
        break


hontai_flags = [False] * out_min
#flags = [False] * out_min

if is_set:
    is_pair = True
    
    #for A in As:
    #    hontai_flags[A] = True

    As = list(set(As))
    n = len(As)

    #for i in range(1, out_min):
    #    if hontai_flags[i]:
    #        A = i

    #        for A in As:
    #            r = 2  
    #            while True:
    #                A0 = A*r
    #                if out_min <= A0:
    #                    break

    #                cur_flag = hontai_flags[A0]
    #                if cur_flag:
    #                    is_pair = False
    #                    break
    #                #flags[A0] = True

    #                r += 1

    #        if not is_pair:
    #            break

    for i in range(n):
        ds = fctr1(As[i])
        for d, _ in ds:
            if hontai_flags[d]:
                is_pair = False
                break
            hontai_flags[d] = True
else:
    is_pair = False

if is_pair:
    print("pairwise coprime")
elif is_set:
    print("setwise coprime")
else:
    print("not coprime")