# 入力

N = int(eval(input()))

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



R = max(A)

prime_factor_counter = [0]*(R+1)



# D[x]にxを割り切れる最初の素数を格納

# 次に行う素因数分解で試し割りのムダを削減するための前準備

D = [0]*(R+1)

for i in range(2, R+1):

    if D[i]:

        continue

    n = i

    while n < R+1:

        if D[n] == 0:

            D[n] = i

        n += i



# 素因数分解し、素因子をカウント

# ex: 12 => 2と3のカウントを+1する

for a in A:

    tmp = a

    while tmp > 1:

        prime_factor = D[tmp]

        prime_factor_counter[prime_factor] += 1

        while tmp%prime_factor == 0:

            tmp //= prime_factor



# 回答出力

if max(prime_factor_counter) < 2:

    print('pairwise coprime')

elif max(prime_factor_counter) - A.count(1) < N:

    print('setwise coprime')

else:

    print('not coprime')
N = int(eval(input()))

A = [0]*(1000001)

for a in list(map(int, input().split())):

    A[a] += 1



# MFPF = Most Frequent Prime Factor

MFPF_n = 0

seen_prime_factor = [0]*(1000001)

for i in range(2, 1000001):

    if seen_prime_factor[i]:

        continue

    n = i

    tmp = 0

    while n < 1000001:

        tmp += A[n]

        seen_prime_factor[n] = 1

        n += i

    MFPF_n = max(MFPF_n, tmp)



if MFPF_n < 2:

    print('pairwise coprime')

elif MFPF_n - A[1] < N:

    print('setwise coprime')

else:

    print('not coprime')
# 入力
N = int(eval(input()))
A = list(map(int, input().split()))
R = max(A)
prime_factor_counter = [0] * (R + 1)
# D[x]にxを割り切れる最初の素数を格納
# 次に行う素因数分解で試し割りのムダを削減するための前準備
D = [0] * (R + 1)
for i in range(2, R + 1):
    if D[i]:
        continue
    n = i
    while n < R + 1:
        if D[n] == 0:
            D[n] = i
        n += i
# 素因数分解し、素因子をカウント
# ex: 12 => 2と3のカウントを+1する
for a in A:
    tmp = a
    while tmp > 1:
        prime_factor = D[tmp]
        prime_factor_counter[prime_factor] += 1
        while tmp % prime_factor == 0:
            tmp //= prime_factor
# 回答出力
if max(prime_factor_counter) < 2:
    print("pairwise coprime")
elif max(prime_factor_counter) - A.count(1) < N:
    print("setwise coprime")
else:
    print("not coprime")

N = int(eval(input()))
A = [0] * (1000001)
for a in list(map(int, input().split())):
    A[a] += 1
# MFPF = Most Frequent Prime Factor
MFPF_n = 0
seen_prime_factor = [0] * (1000001)
for i in range(2, 1000001):
    if seen_prime_factor[i]:
        continue
    n = i
    tmp = 0
    while n < 1000001:
        tmp += A[n]
        seen_prime_factor[n] = 1
        n += i
    MFPF_n = max(MFPF_n, tmp)
if MFPF_n < 2:
    print("pairwise coprime")
elif MFPF_n - A[1] < N:
    print("setwise coprime")
else:
    print("not coprime")

-# 入力 -A = list(map(int, input().split())) -R = max(A) -prime_factor_counter = [0] * (R + 1) -# D[x]にxを割り切れる最初の素数を格納 -# 次に行う素因数分解で試し割りのムダを削減するための前準備 -D = [0] * (R + 1) -for i in range(2, R + 1): -    if D[i]: +A = [0] * (1000001) +for a in list(map(int, input().split())): +    A[a] += 1 +# MFPF = Most Frequent Prime Factor +MFPF_n = 0 +seen_prime_factor = [0] * (1000001) +for i in range(2, 1000001): +    if seen_prime_factor[i]: -    while n < R + 1: -        if D[n] == 0: -            D[n] = i +    tmp = 0 +    while n < 1000001: +        tmp += A[n] +        seen_prime_factor[n] = 1 -# 素因数分解し、素因子をカウント -# ex: 12 => 2と3のカウントを+1する -for a in A: -    tmp = a -    while tmp > 1: -        prime_factor = D[tmp] -        prime_factor_counter[prime_factor] += 1 -        while tmp % prime_factor == 0: -            tmp //= prime_factor -# 回答出力 -if max(prime_factor_counter) < 2: +    MFPF_n = max(MFPF_n, tmp) +if MFPF_n < 2: -elif max(prime_factor_counter) - A.count(1) < N: +elif MFPF_n - A[1] < N: