#!/usr/bin/env python3
import sys
input = sys.stdin.readline

n = int(input())
a = [int(item) for item in input().split()]

smallest_factor = [-1] * (10**6 + 10) 
for i in range(n, 1, -1):
    base = i
    j = 2
    while base * j <= (10**6 + 1):
        smallest_factor[base * j] = i
        j += 1

factor_count = [0] * (10**6 + 10)
is_pairwise = True
for item in a:
    val = item
    pset = set() 
    while smallest_factor[val] != -1:
        pset.add(factor_count[smallest_factor[val]])
        val //= smallest_factor[val]
    pset.add(val)
    for item in pset:
        factor_count[item] += 1
same_p = max(factor_count)
if same_p == 1:
    print("pairwise coprime")
elif same_p == n:
    print("not coprime")
else:
    print("setwise coprime")