from math import gcd
import numpy as np

n = int(input())
a = list(map(int, input().split()))
MAX = 10 ** 6

nums = np.zeros(MAX + 1, np.int64)
for e in a:
    nums[e] += 1


def sieve(x):
    """
    Sieve of Eratosthenes
    :param x: max value
    :return: list of bool
    """

    is_prime = [True] * (x + 1)
    is_prime[0] = is_prime[1] = False

    for i in range(2, x + 1):
        if is_prime[i]:
            for j in range(i * 2, x + 1, i):
                is_prime[j] = False

    return is_prime


g = a[0]
for e in a:
    g = gcd(g, e)

if g != 1:
    print("not coprime")
    exit()

primes = sieve(MAX)
p = [i for i, e in enumerate(primes) if e]

for i, e in enumerate(nums):
    if e:
        if e > 1:
            print("setwise coprime")
            exit()
        nums[i] = 0
        for ep in p:
            if ep > i:
                break

            if i % ep == 0:
                if nums[ep::ep].any():
                    print("setwise coprime")
                    exit()

print("pairwise coprime")
