from math import gcd

N = int(input())
A = list(map(int, input().split()))
exist = [0] * (10**6 + 1)
for a in A:
    exist[a] += 1

g = A[0]
for a in A[1:]:
    g = gcd(g, a)

if g != 1:
    print('not coprime')
elif all([sum(exist[i::i]) <= 1 for i in range(2, 10**6+1)]):
    print('pairwise coprime')
else:
    print('setwise coprime')