import bisect
import math

n = int(input())
As = list(map(int, input().split()))
As.sort()

cons = 10 ** 6
is_prime = [True] * (cons + 1)
Ds = [i for i in range(cons + 1)]
is_prime[0] = False
is_prime[1] = False
for i in range(2, int(cons**0.5) + 1):
    if not is_prime[i]:
        continue
    for j in range(i * 2, cons + 1, i):
        is_prime[j] = False
        if Ds[j] == j:
          Ds[j] = i 

Ps = [i for i in range(cons + 1) if is_prime[i]]
flags = [[0 for _ in range(n)] for _ in range(int(cons**0.5))]
pairwiseFlag = True
setwiseFlag = True

for ia, a in enumerate(As):
  if a <= 1:
    continue
  while a != 1:
    d = Ds[a]
    flags[d][ia] = 1
    a = a // d
for i in range(int(cons**0.5)):
  s = sum(flags[i])
  if s >= 2:
    pairwiseFlag = False
  if s == n:
    setwiseFlag = False

if pairwiseFlag:
  print('pairwise coprime')
elif setwiseFlag:
  print('setwise coprime')
else:
  print('not coprime')
