# -*- coding: utf-8 -*-
"""
Created on Sat Aug 29 22:04:23 2020

@author: liang
"""
def factorization(n):
    arr = set()
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.add(i)

    if temp!=1:
        arr.add(temp)

    if arr=={}:
        arr.add(n)

    return arr

N = int(input())
A = [factorization(int(n)) for n in input().split()]
#print(A)
"""
ans = dict()
isPairwise = True
for st in A:
    for num in st:
        if num in ans.keys():
            ans[num] += 1
            isPairwise = False
            
        else:
            ans[num] = 1
#print(ans)
if isPairwise:
    print("pairwise coprime")
elif any([ans[n] >= N for n in ans.keys()]):
    print("not coprime")
else:
    print("set coprime")
"""

ans2 = set()
count = 0
isPair = True
isSet = False
ans3 = set()
tmp = int()
for st in A:
    for num in st:
        if num in ans2:
            isPair = False
            ans3.add(num)
        ans2.add(num)
    if not isPair:
        break
    count += 1
    if count >= 2:
        isSet = True

isSet = True
for tmp in ans3:
    if all([tmp in A[i] for i in range(N)]):
        isSet = False
    else:
        pass

if count >= 2:
        isSet = True
        
if isPair:
    print("pairwise coprime")
elif isSet:
    print("setwise coprime")
else:
    print("not coprime")