from fractions import gcd

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

A = max(As)
lst = [0]*(A+1)
rlt = [0]*(A+1)

for i in range(2, len(lst)//2):
  if lst[i] > 0:
    continue
  j = 2
  while i*j <= A:
    if lst[i*j] == 0:
      lst[i*j] = i
    j += 1
    
for a in As:
  tmp = -1
  while lst[a] > 0:
    if tmp != lst[a]:
      rlt[lst[a]] += 1
    a //= lst[a]
    tmp = lst[a]
  if a != tmp:
    rlt[a] += 1
    
print(rlt)

if max(rlt) < 2:
  print('pairwise coprime')
  exit()
  
t = As[0]

for a in As:
  t = gcd(t,a)
  
if t == 1:
  print('setwise coprime')
else:
  print('not coprime')