import math
from math import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)
def lcm(x, y):
    return (x * y) // gcd(x, y)

N = int(input())
A = [int(i) for i in input().split()]

left = [0] * N
for i in range(1, N):
    left[i] = gcd(A[i - 1], left[i - 1])
right = [0] * N
for i in range(N - 2, -1, -1):
    right[i] = gcd(A[i + 1], right[i + 1])

left[0] = 1
right[-1] = 1

flag = True
for a, l, r in zip(A, left, right):
    if gcd(l, a) != 1 and gcd(r, a) != 1:
        flag = False
        break

if flag:
    print("pairwise coprime")
else:
    if gcd_list(A) == 1:
        print("setwise coprime")
    else:
        print("not coprime")