n=int(input())
import copy
a=list(map(int,input().split()))
q=copy.copy(a)
m=10**6
tab=[0]*(m+1)
for aa in a:
  tab[aa]=1
for i in range(2,m+1):
  if sum(tab[i::i])>1:
    break
else:
  print('pairwise coprime')
  exit()
from math import gcd
g=gcd(q[0],q[1])
if n==2:
  print('setwise coprime' if g==1 else 'not coprime')
  exit()
for i in range(2,n):
  g=gcd(g,q[i])
if g==1:
  print('setwise coprime')
else:
  print('not coprime')
