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





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():

    spf = SmallestPrimeFactors(1_000_000)

    primes = set()

    for a in A:

        if a == 1:

            continue

        new_primes = set(spf.factor(a))

        if primes & new_primes:

            return False

        primes |= new_primes

    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


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


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():
    spf = SmallestPrimeFactors(1_000_000)
    primes = set()
    for a in A:
        if a == 1:
            continue
        new_primes = set(spf.factor(a))
        if primes & new_primes:
            return False
        primes |= new_primes
    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")

-    M = max(A) -    spf = SmallestPrimeFactors(M) -    counter = [0] * (M + 1) +    spf = SmallestPrimeFactors(1_000_000) +    primes = set() -        for np in new_primes: -            if counter[np]: -                return False -            counter[np] = 1 +        if primes & new_primes: +            return False +        primes |= new_primes