import math
def gcd(x,y):
  return math.gcd(x,y)
  #return y if x%y==0 else gcd(y,x%y)

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


def solve(N,A):
  primes=[];
  isprime=[1 for i in range(0,1001)];
  isprime[1]=0;isprime[0]=0
  for i in range(2,1001):
    if isprime[i]:
      primes.append(i)
      j=2;
      while i*j<=1000:
        isprime[i*j]=0;
        j+=1
  A.sort();
  pc=1
  l=A[0]
  for i in range(1,N):
    if l==A[i] and l!=1:
      pc=0
    l=A[i];

  s=[0 for i in range(0,1001)]
  for i in range(N):
    a=A[i];

    for p in primes:
      if a==1:
        break
      if(a%p==0):
        #while(a%p==0):
        #  a//=p;
        if s[p]:
          pc=0
        s[p]=1
      #if a>=1000:
      #if a!=1:
        #if a in s2:
        #if s[a]:
        #  pc=0
        #s2.add(a)
        #s[a]=1


  g=A[0];
  for i in range(1,N):
    g=gcd(g,A[i])
  print("pairwise coprime"if pc else("setwise coprime"if g==1 else "not coprime"))
def solve2(N,A):
  pc=1;
  for i in range(N):
    for j in range(i+1,N):
      pc*=(gcd(A[i],A[j])==1)
  g=A[0];
  for i in range(1,N):
    g=gcd(g,A[i]);
  print("pairwise coprime"if pc else("setwise coprime"if g==1 else "not coprime"))
#import random
#N=random.randrange(1,10)  
#A=[]
#for i in range(N):
#  A.append(random.randrange(1000000));
#  print(A[i])
solve(N,A)
#solve2(N,A)
#solve(2,[1,1])
#solve2(2,[1,1])