from collections import defaultdict
import sys
input = sys.stdin.readline


def factorization(n, primes):
    arr = []
    temp = n
    for i in primes:
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append(i)

    if temp != 1:
        arr.append(temp)

    return arr


def get_sieve_of_eratosthenes_new(n):
    import math
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]


def main():
    n = int(input())
    A = list(map(int, input().split()))

    primes = get_sieve_of_eratosthenes_new(10**6)
    fact_dict = defaultdict(int)
    for a in A:
        facts = factorization(a, primes)
        for fact in facts:
            fact_dict[fact] += 1

    if not fact_dict.values():
        count = 1
    else:
        count = max(fact_dict.values())
    if count == 1:
        print("pairwise coprime")
    elif count != n:
        print("setwise coprime")
    else:
        print("not coprime")


if __name__ == "__main__":
    main()
