def factorize(n):
    tmp = n
    flag = False

    for i in range(2, int(-(-n**0.5//1))+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            if i in prime_cnt:
                prime_cnt[i] += 1
            else:
                prime_cnt[i] = 1
            flag = True
         
    if tmp != 1:
        if tmp in prime_cnt:
            prime_cnt[tmp] += 1
        else:
            prime_cnt[tmp] = 1
        flag = True
    
    if not flag:
        if n in prime_cnt:
            prime_cnt[n] += 1
        else:
            prime_cnt[n] = 1

N = int(input())
A = list(map(int, input().split()))

prime_cnt = {}

for i in range(N):
    if A[i] != 1:
        factorize(A[i])

pw_cp = True
st_cp = True

for val in prime_cnt.values():
    if val != 1:
        pw_cp = False
    if val == N:
        st_cp = False

print(prime_cnt)

if pw_cp:
    print('pairwise coprime')
elif st_cp:
    print('setwise coprime')
else:
    print('not coprime')