from functools import reduce

from math import gcd

n = int(eval(input()))

aa = list(map(int, input().split()))

ma = max(aa)

cnt = [0] * (ma+1)



for a in aa:

    cnt[a] += 1



if reduce(gcd, aa) != 1:

    print('not coprime')

elif all([sum(cnt[i::i]) <= 1 for i in range(2, ma)]):

    print('pairwise coprime')

else:

    print('setwise coprime')
from functools import reduce

from math import gcd

n = int(eval(input()))

aa = list(map(int, input().split()))

ma = max(aa)

cnt = [0] * (ma+1)



for a in aa:

    cnt[a] += 1



if reduce(gcd, aa) != 1:

    print('not coprime')

elif all(sum(cnt[i::i]) <= 1 for i in range(2, ma)):

    print('pairwise coprime')

else:

    print('setwise coprime')
from functools import reduce
from math import gcd

n = int(eval(input()))
aa = list(map(int, input().split()))
ma = max(aa)
cnt = [0] * (ma + 1)
for a in aa:
    cnt[a] += 1
if reduce(gcd, aa) != 1:
    print("not coprime")
elif all([sum(cnt[i::i]) <= 1 for i in range(2, ma)]):
    print("pairwise coprime")
else:
    print("setwise coprime")

from functools import reduce
from math import gcd

n = int(eval(input()))
aa = list(map(int, input().split()))
ma = max(aa)
cnt = [0] * (ma + 1)
for a in aa:
    cnt[a] += 1
if reduce(gcd, aa) != 1:
    print("not coprime")
elif all(sum(cnt[i::i]) <= 1 for i in range(2, ma)):
    print("pairwise coprime")
else:
    print("setwise coprime")

-elif all([sum(cnt[i::i]) <= 1 for i in range(2, ma)]): +elif all(sum(cnt[i::i]) <= 1 for i in range(2, ma)):