from math import gcd, sqrt



def Divisor_Set(n):

    s = set()

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

        if n%i == 0:

            s.add(i)

            s.add(n//i)

    return s



def main():

    n = int(eval(input()))

    a = list(map(int, input().split()))

    f = True

    divset = set()

    for v in a:

        st = Divisor_Set(v)

        st.remove(1)

        for el in st:

            if el in divset:

                f = False

                break

            divset.add(el)

        if not f:

            break

    if f:

        print("pairwise coprime")

    else:

        all_gcd = a[0]

        for i in range(1, n):

            all_gcd = gcd(all_gcd, a[i])

        if all_gcd == 1:

            print("setwise coprime")

        else:

            print("not coprime")



if __name__ == "__main__":

    main()
from math import gcd

class Factor:

    def __init__(self, max_element):

        self.minFactor = [-1]*(max_element+1)

        for i in range(2, max_element+1):

            if self.minFactor[i] == -1:

                for j in range(i, max_element+1, i):

                    self.minFactor[j] = i

    def getFactorSet(self, element):

        retSet = set(1)

        while element > 1:

            retSet.add(element)

            retSet.add(self.minFactor[element])

            element //= self.minFactor[element]

        return retSet

    def getPrimeFactorSet(self, element):

        retSet = set()

        while element > 1:

            retSet.add(self.minFactor[element])

            element //= self.minFactor[element]

        return retSet

    def getPrimeFactorDic(self, element):

        retDic = {}

        while element > 1:

            val = self.minFactor[element]

            if val in retDic:

                retDic[val] += 1

            else:

                retDic[val] = 1

            element //= val

        return retDic



def main():

    n = int(eval(input()))

    a = list(map(int, input().split()))

    f = True

    fact = Factor(max(a))

    st = set()

    for v in a:

        fac_set = fact.getPrimeFactorSet(v)

        for u in fac_set:

            if u in st:

                f = False

                break

            st.add(u)

        if not f:

            break

    if f:

        print("pairwise coprime")

    else:

        all_gcd = a[0]

        for i in range(1, n):

            all_gcd = gcd(all_gcd, a[i])

        if all_gcd == 1:

            print("setwise coprime")

        else:

            print("not coprime")



if __name__ == "__main__":

    main()
from math import gcd, sqrt


def Divisor_Set(n):
    s = set()
    for i in range(1, int(sqrt(n)) + 2):
        if n % i == 0:
            s.add(i)
            s.add(n // i)
    return s


def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    f = True
    divset = set()
    for v in a:
        st = Divisor_Set(v)
        st.remove(1)
        for el in st:
            if el in divset:
                f = False
                break
            divset.add(el)
        if not f:
            break
    if f:
        print("pairwise coprime")
    else:
        all_gcd = a[0]
        for i in range(1, n):
            all_gcd = gcd(all_gcd, a[i])
        if all_gcd == 1:
            print("setwise coprime")
        else:
            print("not coprime")


if __name__ == "__main__":
    main()

from math import gcd


class Factor:
    def __init__(self, max_element):
        self.minFactor = [-1] * (max_element + 1)
        for i in range(2, max_element + 1):
            if self.minFactor[i] == -1:
                for j in range(i, max_element + 1, i):
                    self.minFactor[j] = i

    def getFactorSet(self, element):
        retSet = set(1)
        while element > 1:
            retSet.add(element)
            retSet.add(self.minFactor[element])
            element //= self.minFactor[element]
        return retSet

    def getPrimeFactorSet(self, element):
        retSet = set()
        while element > 1:
            retSet.add(self.minFactor[element])
            element //= self.minFactor[element]
        return retSet

    def getPrimeFactorDic(self, element):
        retDic = {}
        while element > 1:
            val = self.minFactor[element]
            if val in retDic:
                retDic[val] += 1
            else:
                retDic[val] = 1
            element //= val
        return retDic


def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    f = True
    fact = Factor(max(a))
    st = set()
    for v in a:
        fac_set = fact.getPrimeFactorSet(v)
        for u in fac_set:
            if u in st:
                f = False
                break
            st.add(u)
        if not f:
            break
    if f:
        print("pairwise coprime")
    else:
        all_gcd = a[0]
        for i in range(1, n):
            all_gcd = gcd(all_gcd, a[i])
        if all_gcd == 1:
            print("setwise coprime")
        else:
            print("not coprime")


if __name__ == "__main__":
    main()

-from math import gcd, sqrt +from math import gcd -def Divisor_Set(n): -    s = set() -    for i in range(1, int(sqrt(n)) + 2): -        if n % i == 0: -            s.add(i) -            s.add(n // i) -    return s +class Factor: +    def __init__(self, max_element): +        self.minFactor = [-1] * (max_element + 1) +        for i in range(2, max_element + 1): +            if self.minFactor[i] == -1: +                for j in range(i, max_element + 1, i): +                    self.minFactor[j] = i + +    def getFactorSet(self, element): +        retSet = set(1) +        while element > 1: +            retSet.add(element) +            retSet.add(self.minFactor[element]) +            element //= self.minFactor[element] +        return retSet + +    def getPrimeFactorSet(self, element): +        retSet = set() +        while element > 1: +            retSet.add(self.minFactor[element]) +            element //= self.minFactor[element] +        return retSet + +    def getPrimeFactorDic(self, element): +        retDic = {} +        while element > 1: +            val = self.minFactor[element] +            if val in retDic: +                retDic[val] += 1 +            else: +                retDic[val] = 1 +            element //= val +        return retDic -    divset = set() +    fact = Factor(max(a)) +    st = set() -        st = Divisor_Set(v) -        st.remove(1) -        for el in st: -            if el in divset: +        fac_set = fact.getPrimeFactorSet(v) +        for u in fac_set: +            if u in st: -            divset.add(el) +            st.add(u)