import math
import numpy as np
from functools import reduce

#GCD(A1 ~ AN)を出す
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
  
#エラトネスの篩による素数列挙
def eratosthenes(limit):
  A = [i for i in range(2, limit+1)]
  P = []
  time = 0
  while True:
    prime = min(A)
    if prime > math.sqrt(limit):
      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

#全ての1<=i<j<=Nについて、GCD(Ai,Aj)=1が成り立つかのチェック
def pairwise_coprime_check(A, D):
  p_count = [0] * (max(A) + 1)
  for a in A:
    temp = a
    d = 0
    while temp != 1:
      if p_count[D[temp]] == 1 and d != D[temp]:
        return False
      p_count[D[temp]] = 1
      d = D[temp]
      temp //= D[temp]
  return True

#標準入力
N = int(input())
A = list(map(int,input().split()))

#整数の最大値を取得
A_max = max(A)

#本体
if gcd_list(A) == 1:
  D = eratosthenes(A_max)
  if pairwise_coprime_check(A, D):
    print("pairwise coprime")
  else:
    print("setwise coprime")
else:
  print("not coprime")