import sys
input = sys.stdin.readline
N = int(input())
A = map(int, input().split())

is_prime = [1] * 1001
is_prime[0] = 0
is_prime[1] = 0
for current in range(2, 1001):
  if is_prime[current]:
    for i in range(2, 1 + 1000//current):
      is_prime[i*current] = 0
primes = []
for i in range(2, 1001):
  if is_prime[i]:
    primes.append(i)

def factorize(n):
  factors = set()
  for p in primes:
    if n % p == 0:
      factors.add(p)
      while n % p == 0:
        n //= p
    if p * p > n:
      if n > 1:
        factors.add(n)
      break
  return factors

p_coprime = True
common_factors = None
appeared_factors = None
for a in A:
  f = factorize(a)
  #print(a, f, p_coprime, common_factors, appeared_factors) 
  if common_factors == None:
    common_factors = f
    appeared_factors = f
  else:
    if appeared_factors & f:
      p_coprime = False
    common_factors = common_factors & f
    appeared_factors = appeared_factors | f
  #print(a, f, p_coprime, common_factors, appeared_factors) 
if p_coprime:
  print('pairwise coprime')
elif not common_factors:
  print('setwise coprime')
else:
  print('not coprime')
    
  
