from math import gcd

from functools import reduce





def main():

    eval(input())  # N

    array = [int(x) for x in input().split()]

    MAX_A = 10 ** 6 + 1

    histogram = [0] * MAX_A

    for x in array:

        histogram[int(x)] += 1



    # エラトステネスの篩

    primes = []

    not_primes = set()

    for a in range(2, MAX_A):

        if a in not_primes:

            continue

        primes.append(a)

        for b in range(a * 2, MAX_A, a):

            not_primes.add(b)



    for divider in primes:

        count = sum(histogram[divider::divider])

        if count > 1:

            break

    else:

        return 'pairwise coprime'



    gcd_total = reduce(gcd, array)

    if gcd_total == 1:

        return 'setwise coprime'

    else:

        return 'not coprime'





if __name__ == '__main__':

    print((main()))

from math import gcd

from functools import reduce





def facs(n):

    """試し割り法における割る数を生成する。"""

    yield 2

    for x in range(3, n, 2):

        yield x





def main():

    eval(input())  # N

    array = [int(x) for x in input().split()]

    MAX_A = 10 ** 6 + 1

    histogram = [0] * MAX_A

    for x in array:

        histogram[int(x)] += 1



    for divider in facs(MAX_A):

        count = sum(histogram[divider::divider])

        if count > 1:

            break

    else:

        return 'pairwise coprime'



    gcd_total = reduce(gcd, array)

    if gcd_total == 1:

        return 'setwise coprime'

    else:

        return 'not coprime'





if __name__ == '__main__':

    print((main()))

from math import gcd
from functools import reduce


def main():
    eval(input())  # N
    array = [int(x) for x in input().split()]
    MAX_A = 10**6 + 1
    histogram = [0] * MAX_A
    for x in array:
        histogram[int(x)] += 1
    # エラトステネスの篩
    primes = []
    not_primes = set()
    for a in range(2, MAX_A):
        if a in not_primes:
            continue
        primes.append(a)
        for b in range(a * 2, MAX_A, a):
            not_primes.add(b)
    for divider in primes:
        count = sum(histogram[divider::divider])
        if count > 1:
            break
    else:
        return "pairwise coprime"
    gcd_total = reduce(gcd, array)
    if gcd_total == 1:
        return "setwise coprime"
    else:
        return "not coprime"


if __name__ == "__main__":
    print((main()))

from math import gcd
from functools import reduce


def facs(n):
    """試し割り法における割る数を生成する。"""
    yield 2
    for x in range(3, n, 2):
        yield x


def main():
    eval(input())  # N
    array = [int(x) for x in input().split()]
    MAX_A = 10**6 + 1
    histogram = [0] * MAX_A
    for x in array:
        histogram[int(x)] += 1
    for divider in facs(MAX_A):
        count = sum(histogram[divider::divider])
        if count > 1:
            break
    else:
        return "pairwise coprime"
    gcd_total = reduce(gcd, array)
    if gcd_total == 1:
        return "setwise coprime"
    else:
        return "not coprime"


if __name__ == "__main__":
    print((main()))

+ + +def facs(n): +    """試し割り法における割る数を生成する。""" +    yield 2 +    for x in range(3, n, 2): +        yield x -    # エラトステネスの篩 -    primes = [] -    not_primes = set() -    for a in range(2, MAX_A): -        if a in not_primes: -            continue -        primes.append(a) -        for b in range(a * 2, MAX_A, a): -            not_primes.add(b) -    for divider in primes: +    for divider in facs(MAX_A):