import math
from functools import reduce

def setwise_coprime_check(numbers):
  return reduce(math.gcd, numbers)

def eratosthenes(max_A):
  A = [i for i in range(2, max_A + 1)]
  P = []
  time = 0
  
  while True:
    prime = min(A)
    if prime > math.sqrt(max_A):
      break
    P.append(prime)
    i = 0
    while i < len(A):
      if A[i] % prime == 0:
        A.pop(i)
        continue
      i += 1
  for a in A:
    P.append(a)
  return P

def prime_factorization(a,D):
  ls = []
  for d in D:
    if d > a:
      break
    if a % d == 0:
      ls.append(d)
  return ls
  
def prime_decomposition(x):
  i = 2
  ls = []
  while i * i <= x:
    while x % i == 0:
      x /= i
      ls.append(i)
    i += 1
  if x > 1:
    ls.append(x)
  return ls

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

if setwise_coprime_check(A) == 1:
  D = eratosthenes(max(A))
  P = [0] * (max(A) + 1)
  for a in A:
    ls = prime_factorization(a,D)
    for i in ls:
      P[i] += 1

  if max(P) <= 1:
    print("pairwise coprime")
  else:
    print("setwise coprime")

else:
  print("not coprime")