import sys
import bisect
from functools import lru_cache
from collections import defaultdict
inf = float('inf')
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline().rstrip()
def read():
  return int(readline())
def reads():
  return map(int, readline().split())
N=read()
A=list(reads())
import math

def create_sieve(n):
    sieve = [0] * (n + 1)

    for i in range(2, n + 1):
        if sieve[i] == 0:
            j = i ** 2
            while j <= n:
                sieve[j] = i
                j += i

    return sieve
def fast_factorization(n, sieve):
    from collections import Counter
    arr = Counter()
    while n > 1:
        p = sieve[n]
        if p == 0:
            arr[n] += 1
            break
        else:
            arr[p] += 1
            n //= p
    return arr
M = 10 ** 6
sieve = create_sieve(M)
done = set() # 素数の重複をチェックするためのset
dic=defaultdict(int)
res=""
for i in range(N-1,-1,-1):
  ls = fast_factorization(A[i], sieve)
  for lval in ls:
      dic[lval]+=1
  for j in range(len(ls)):
          if dic[ls[j]]!=1: 
              res=""
              break
          if j==len(ls)-1:
              res="pairwise coprime"
if res!="":
    print(res)
    exit()
for val in dic.values():
    if val==N:
        res="not coprime"
        print(res)
        exit()
print("setwise coprime")