import sys

def I(): return int(sys.stdin.readline().rstrip())

def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり





N = I()

A = LI()





from math import gcd



g = 0  # Aiたちの最大公約数

for i in range(N):

    g = gcd(g,A[i])



if g != 1:

    print('not coprime')

    exit()





B = [0]*(10**6+1)

for i in range(N):

    B[A[i]] += 1



for d in range(2,5*10**5+1):

    a = sum(B[i] for i in range(d,10**6+1,d))

    if a >= 2:

        print('setwise coprime')

        break

else:

    print('pairwise coprime')



# 計算量 O(A*logA)

# A = max(Ai)

import sys

def I(): return int(sys.stdin.readline().rstrip())

def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり





N = I()

A = LI()





from math import gcd



g = 0  # Aiたちの最大公約数

for i in range(N):

    g = gcd(g,A[i])



if g != 1:

    print('not coprime')

    exit()





# osa_k法



B = [0]*(10**6+1)  # B[i] = iの最小の素因数

for i in range(2,10**3+1):

    if B[i] == 0:

        for j in range(i,10**6+1,i):

            if B[j] == 0:

                B[j] = i

for i in range(10**3+1,10**6+1):

    if B[i] == 0:

        B[i] = i





C = [0]*(10**6+1)  # C[i] = 1 ⇔ Aの中に素因数iを持つものが存在する

for i in range(N):

    a = A[i]

    while a != 1:

        b = B[a]

        if C[b] == 1:

            print('setwise coprime')

            exit()

        else:

            C[b] = 1

            while a % b == 0:

                a //= b



print('pairwise coprime')



# 計算量 O(A*loglogA+N*logA) ?

# A = max(Ai)

import sys


def I():
    return int(sys.stdin.readline().rstrip())


def LI():
    return list(map(int, sys.stdin.readline().rstrip().split()))  # 空白あり


N = I()
A = LI()
from math import gcd

g = 0  # Aiたちの最大公約数
for i in range(N):
    g = gcd(g, A[i])
if g != 1:
    print("not coprime")
    exit()
B = [0] * (10**6 + 1)
for i in range(N):
    B[A[i]] += 1
for d in range(2, 5 * 10**5 + 1):
    a = sum(B[i] for i in range(d, 10**6 + 1, d))
    if a >= 2:
        print("setwise coprime")
        break
else:
    print("pairwise coprime")
# 計算量 O(A*logA)
# A = max(Ai)

import sys


def I():
    return int(sys.stdin.readline().rstrip())


def LI():
    return list(map(int, sys.stdin.readline().rstrip().split()))  # 空白あり


N = I()
A = LI()
from math import gcd

g = 0  # Aiたちの最大公約数
for i in range(N):
    g = gcd(g, A[i])
if g != 1:
    print("not coprime")
    exit()
# osa_k法
B = [0] * (10**6 + 1)  # B[i] = iの最小の素因数
for i in range(2, 10**3 + 1):
    if B[i] == 0:
        for j in range(i, 10**6 + 1, i):
            if B[j] == 0:
                B[j] = i
for i in range(10**3 + 1, 10**6 + 1):
    if B[i] == 0:
        B[i] = i
C = [0] * (10**6 + 1)  # C[i] = 1 ⇔ Aの中に素因数iを持つものが存在する
for i in range(N):
    a = A[i]
    while a != 1:
        b = B[a]
        if C[b] == 1:
            print("setwise coprime")
            exit()
        else:
            C[b] = 1
            while a % b == 0:
                a //= b
print("pairwise coprime")
# 計算量 O(A*loglogA+N*logA) ?
# A = max(Ai)

-B = [0] * (10**6 + 1) +# osa_k法 +B = [0] * (10**6 + 1)  # B[i] = iの最小の素因数 +for i in range(2, 10**3 + 1): +    if B[i] == 0: +        for j in range(i, 10**6 + 1, i): +            if B[j] == 0: +                B[j] = i +for i in range(10**3 + 1, 10**6 + 1): +    if B[i] == 0: +        B[i] = i +C = [0] * (10**6 + 1)  # C[i] = 1 ⇔ Aの中に素因数iを持つものが存在する -    B[A[i]] += 1 -for d in range(2, 5 * 10**5 + 1): -    a = sum(B[i] for i in range(d, 10**6 + 1, d)) -    if a >= 2: -        print("setwise coprime") -        break -else: -    print("pairwise coprime") -# 計算量 O(A*logA) +    a = A[i] +    while a != 1: +        b = B[a] +        if C[b] == 1: +            print("setwise coprime") +            exit() +        else: +            C[b] = 1 +            while a % b == 0: +                a //= b +print("pairwise coprime") +# 計算量 O(A*loglogA+N*logA) ?