# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
A=list(map(int,input().split()))

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
ans=True

next=[]

f=False
MIN_A=INF
for x in A:
    if x==1:
        f=True
    else:
        next.append(x)
        MIN_A=min(MIN_A,x)
A=next
next=[]

while A:
    prime=prime_factorize(MIN_A)
    MIN_A=INF
    for p in prime:
        cnt=0
        for i,x in enumerate(A):
            MIN_A=min(MIN_A,x)
            if x%p==0:
                cnt+=1
                while x%p==0:
                    x//=p
                if x!=1:
                    next.append(x)
        if cnt>=2:
            ans=False
        if cnt==N and not f:
            print('not coprime')
            exit()
        A=next
        next=[]

if ans:
    print('pairwise coprime')
else:
    print('setwise coprime')