from math import gcd

from functools import reduce





def factor(n):

    res = []

    for i in range(2, int(n ** 0.5) + 1):

        while n % i == 0:

            res.append(i)

            n //= i

    if n > 1:

        return res + [n]

    else:

        return res





def solve():

    PC = "pairwise coprime"

    SC = "setwise coprime"

    NC = "not coprime"

    is_PC = True

    is_SC = True



    N, *A = list(map(int, open(0).read().split()))



    primes = set()

    for a in A:

        if a == 1:

            continue

        new_primes = set(factor(a))

        if new_primes & primes:

            is_PC = False

            break

        primes |= set(factor(a))



    if reduce(gcd, A) != 1:

        is_SC = False



    if is_PC:

        print(PC)

    elif is_SC:

        print(SC)

    else:

        print(NC)





solve()

from math import gcd

from functools import reduce





class SmallestPrimeFactors:

    def __init__(self, n):

        self.spf = list(range(n + 1))

        for i in range(2, int(n ** 0.5) + 1):

            if self.spf[i] == i:

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

                    if self.spf[j] == j:

                        self.spf[j] = i



    def factor(self, x):

        if self.spf[x] == x:

            return [x]

        nxt = x // self.spf[x]

        return self.factor(nxt) + [self.spf[x]]





def is_PC():

    M = max(A)

    spf = SmallestPrimeFactors(M)

    counter = [0] * (M + 1)

    for a in A:

        if a == 1:

            continue

        new_primes = set(spf.factor(a))

        for np in new_primes:

            if counter[np]:

                return False

            counter[np] = 1

    return True





def is_SC():

    return reduce(gcd, A) == 1





N, *A = list(map(int, open(0).read().split()))

if not is_SC():

    print("not coprime")

elif is_PC():

    print("pairwise coprime")

else:

    print("setwise coprime")

from math import gcd
from functools import reduce


def factor(n):
    res = []
    for i in range(2, int(n**0.5) + 1):
        while n % i == 0:
            res.append(i)
            n //= i
    if n > 1:
        return res + [n]
    else:
        return res


def solve():
    PC = "pairwise coprime"
    SC = "setwise coprime"
    NC = "not coprime"
    is_PC = True
    is_SC = True
    N, *A = list(map(int, open(0).read().split()))
    primes = set()
    for a in A:
        if a == 1:
            continue
        new_primes = set(factor(a))
        if new_primes & primes:
            is_PC = False
            break
        primes |= set(factor(a))
    if reduce(gcd, A) != 1:
        is_SC = False
    if is_PC:
        print(PC)
    elif is_SC:
        print(SC)
    else:
        print(NC)


solve()

from math import gcd
from functools import reduce


class SmallestPrimeFactors:
    def __init__(self, n):
        self.spf = list(range(n + 1))
        for i in range(2, int(n**0.5) + 1):
            if self.spf[i] == i:
                for j in range(i * i, n + 1, i):
                    if self.spf[j] == j:
                        self.spf[j] = i

    def factor(self, x):
        if self.spf[x] == x:
            return [x]
        nxt = x // self.spf[x]
        return self.factor(nxt) + [self.spf[x]]


def is_PC():
    M = max(A)
    spf = SmallestPrimeFactors(M)
    counter = [0] * (M + 1)
    for a in A:
        if a == 1:
            continue
        new_primes = set(spf.factor(a))
        for np in new_primes:
            if counter[np]:
                return False
            counter[np] = 1
    return True


def is_SC():
    return reduce(gcd, A) == 1


N, *A = list(map(int, open(0).read().split()))
if not is_SC():
    print("not coprime")
elif is_PC():
    print("pairwise coprime")
else:
    print("setwise coprime")

-def factor(n): -    res = [] -    for i in range(2, int(n**0.5) + 1): -        while n % i == 0: -            res.append(i) -            n //= i -    if n > 1: -        return res + [n] -    else: -        return res +class SmallestPrimeFactors: +    def __init__(self, n): +        self.spf = list(range(n + 1)) +        for i in range(2, int(n**0.5) + 1): +            if self.spf[i] == i: +                for j in range(i * i, n + 1, i): +                    if self.spf[j] == j: +                        self.spf[j] = i + +    def factor(self, x): +        if self.spf[x] == x: +            return [x] +        nxt = x // self.spf[x] +        return self.factor(nxt) + [self.spf[x]] -def solve(): -    PC = "pairwise coprime" -    SC = "setwise coprime" -    NC = "not coprime" -    is_PC = True -    is_SC = True -    N, *A = list(map(int, open(0).read().split())) -    primes = set() +def is_PC(): +    M = max(A) +    spf = SmallestPrimeFactors(M) +    counter = [0] * (M + 1) -        new_primes = set(factor(a)) -        if new_primes & primes: -            is_PC = False -            break -        primes |= set(factor(a)) -    if reduce(gcd, A) != 1: -        is_SC = False -    if is_PC: -        print(PC) -    elif is_SC: -        print(SC) -    else: -        print(NC) +        new_primes = set(spf.factor(a)) +        for np in new_primes: +            if counter[np]: +                return False +            counter[np] = 1 +    return True -solve() +def is_SC(): +    return reduce(gcd, A) == 1 + + +N, *A = list(map(int, open(0).read().split())) +if not is_SC(): +    print("not coprime") +elif is_PC(): +    print("pairwise coprime") +else: +    print("setwise coprime")