### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
MAX= 10**6

from math import gcd, sqrt
g = A[0]
# g_list = [A[0]]
for i in range(1, N):
    g = gcd(g, A[i])
    # g_list.append(g)
if g != 1:
    print("not coprime")
    exit()
else:
    def makePrimeChecker(n):
        """
        エラトステネスの篩.
        nまでの自然数が素数かどうかを表すリストを返す.
        """
        isPrime = [True] * (n + 1)
        isPrime[0] = False
        isPrime[1] = False
        for i in range(2, int(n ** 0.5) + 1):
            if isPrime[i]:
                for j in range(i * i, n + 1, i):
                    isPrime[j] = False
        return isPrime

    is_prime = makePrimeChecker(MAX)
    used_prime = [0]*(MAX+1)
    primes = [n for n in range(2, MAX+1) if is_prime[n]]

    # def factorization(n, used_prime):
    #     arr = []
    #     temp = n
    #     is_ok = 1
    #     for i in range(2, int(-(-n**0.5//1))+1):
    #         if temp%i==0:
    #             cnt=0
    #             if used_prime[i]:
    #                 is_ok = 0
    #                 break
    #             while temp%i==0:
    #                 cnt+=1
    #                 temp //= i
    #             arr.append([i, cnt])
    #             used_prime[i] = 1

    #     if is_prime[temp]:
    #         if used_prime[temp]:
    #             is_ok = 0
    #         # arr.append([temp, 1])
    #         used_prime[temp] = 1


    #     if is_prime[n]:
    #         # arr.append([n, 1])
    #         if used_prime[n]:
    #             is_ok = 0
    #         used_prime[n] = 1
    #     return is_ok, used_prime

    # def divisor(num):
    #     max_num = int(sqrt(num))
    #     divisor_list = []
    #     for i in range(1, max_num + 1):
    #         if num % i == 0:
    #             divisor_list.append(i)
    #             divisor_list.append(num//i)
        
    #     return divisor_list

    
    is_ok = 1
    for p in primes:
        for a in A:
            if a % p == 0:
                if used_prime[p]:
                    is_ok = 0
                    break
                used_prime[p] = 1
        if not is_ok:
            break
    if is_ok:
        print("pairwise coprime")
    else:
        print("setwise coprime")
        

### FIXED CODE ###

from math import gcd

N = int(input())
A = list(map(int, input().split()))
MAX = 10**6 + 1

def prime_factor_sieve(n):
    """
    エラトステネスの篩で、
    2 ~ Nの各数に対して、その整数のもつ最小の素因数
    (その整数を篩落とした最小の素因数)を記録して返す
    O(nloglog(n))
    """
    res = [i for i in range(n+1)]
    for i in range(2, int(n**0.5)+1):
        if res[i] < i:
            continue
        for j in range(i*i, n+1, i):
            if res[j] == j:
                res[j] = i
    return res

def factorization(n, min_factor, used_factor, cnt):
    """
    エラトステネスの篩で手に入れた、各整数の最小素因数のリスト
    からO(log(n))で素因数分解する
    """
    
    while n > 1:
        if used_factor[min_factor[n]] == 0:
            used_factor[min_factor[n]] = cnt
        elif used_factor[min_factor[n]] != cnt:
            return False
        n //= min_factor[n]
        # 割った後の素因数についてもO(1)で参照できる
    return True


# 素因数が重複しているかを調べる
min_factor = prime_factor_sieve(MAX)
res = set()
is_ok = 1
used_factor = [0]*(MAX+1)
cnt = 1
for a in A:
    if a == 1:
        continue
    is_ok = factorization(a, min_factor, used_factor, cnt)
    cnt += 1
    if not is_ok:
        break

if is_ok:
    print("pairwise coprime")
else:
    g = A[0]
    for i in range(1, N):
        g = gcd(g, A[i])
    if g == 1:
        print("setwise coprime")
    else:
        print("not coprime")