import sys
read = sys.stdin.readline
import time
from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
from collections import deque 


def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
start_time = time.perf_counter()
# ------------------------------

def lcd(a, b):
    return a * b // gcd(a, b)

N = inp()
A = inpl()

pw = True
pwnum = A[0]

swnum = A[0]

for i in range(1, N):
    if pw:
        gc = gcd(pwnum, A[i])
        if gc != 1:
            pw = False
        pwnum = pwnum * A[i] // gc
    if swnum != 1:
        swnum = gcd(swnum, A[i])

if pw:
    print('pairwise coprime')
elif swnum == 1:
    print('setwise coprime')
else:
    print('not coprime')

# -----------------------------
end_time = time.perf_counter()
print('time:', end_time-start_time, file=sys.stderr)

