from itertools import groupby



class Osa_k:

    def __init__(self, n_max):

        self.min_factor = min_factor = list(range(n_max+1))

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

            if min_factor[i] == i:

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

                    if min_factor[j] == j:

                        min_factor[j] = i



    def __call__(self, n):

        min_factor = self.min_factor

        n_twoes = (n & -n).bit_length() - 1  # 最悪ケースでは速くなる

        res = [2] * n_twoes

        n >>= n_twoes

        while n > 1:

            p = min_factor[n]

            res.append(p)

            n //= p

        return res



def main():

    N = int(eval(input()))

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

    osa_k = Osa_k(1010101)

    Factors = [osa_k(a) for a in A]

    factors = Factors[0]

    st0 = set(factors)  # 0 になれば setwize

    st1 = set(factors)  # 重複しなければ pairwise

    pairwise = True

    for factors in Factors[1:]:

        st = []

        for f, _ in groupby(factors):

            if f in st1:

                pairwise = False

            else:

                st1.add(f)

            st.append(f)

        st0 &= set(st)

    if pairwise:

        print("pairwise coprime")

    elif not st0:

        print("setwise coprime")

    else:

        print("not coprime")



main()

def numba_compile(numba_config):

    import os, sys

    if sys.argv[-1] == "ONLINE_JUDGE":

        from numba import njit

        from numba.pycc import CC

        cc = CC("my_module")

        for func, signature in numba_config:

            globals()[func.__name__] = njit(signature)(func)

            cc.export(func.__name__, signature)(func)

        cc.compile()

        exit()

    elif os.name == "posix":

        exec(f"from my_module import {','.join(func.__name__ for func, _ in numba_config)}")

        for func, _ in numba_config:

            globals()[func.__name__] = vars()[func.__name__]

    else:

        from numba import njit

        for func, signature in numba_config:

            globals()[func.__name__] = njit(signature, cache=True)(func)

        print("compiled!", file=sys.stderr)



import sys

import numpy as np



def solve(N, A):

    def osa_k_construct(n_max):

        min_factor = np.arange(n_max+1)

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

            if min_factor[i] == i:

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

                    if min_factor[j] == j:

                        min_factor[j] = i

        return min_factor



    def osa_k_factorize(min_factor, n):

        min_factor = min_factor

        # n_twoes = (n & -n).bit_length() - 1

        # res = [2] * n_twoes

        # n >>= n_twoes

        res = [0]*0

        while n > 1:

            p = min_factor[n]

            res.append(p)

            n //= p

        return res



    osa_k = osa_k_construct(1010101)

    Factors = [osa_k_factorize(osa_k, a) for a in A]

    factors = Factors[0]

    st0 = set(factors)  # 0 になれば setwize

    st1 = set(factors)  # 重複しなければ pairwise

    pairwise = True

    for factors in Factors[1:]:

        st = set(factors)

        for f in st:

            if f in st1:

                pairwise = False

            else:

                st1.add(f)

        st0 &= st

    if pairwise:

        print("pairwise coprime")

    elif not st0:

        print("setwise coprime")

    else:

        print("not coprime")



numba_compile([

    [solve, "void(i8,i8[:])"]

])



def main():

    input = sys.stdin.buffer.readline

    N = int(input())

    A = np.array(input().split(), dtype=np.int64)

    solve(N, A)



main()

from itertools import groupby


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

    def __call__(self, n):
        min_factor = self.min_factor
        n_twoes = (n & -n).bit_length() - 1  # 最悪ケースでは速くなる
        res = [2] * n_twoes
        n >>= n_twoes
        while n > 1:
            p = min_factor[n]
            res.append(p)
            n //= p
        return res


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    osa_k = Osa_k(1010101)
    Factors = [osa_k(a) for a in A]
    factors = Factors[0]
    st0 = set(factors)  # 0 になれば setwize
    st1 = set(factors)  # 重複しなければ pairwise
    pairwise = True
    for factors in Factors[1:]:
        st = []
        for f, _ in groupby(factors):
            if f in st1:
                pairwise = False
            else:
                st1.add(f)
            st.append(f)
        st0 &= set(st)
    if pairwise:
        print("pairwise coprime")
    elif not st0:
        print("setwise coprime")
    else:
        print("not coprime")


main()

def numba_compile(numba_config):
    import os, sys

    if sys.argv[-1] == "ONLINE_JUDGE":
        from numba import njit
        from numba.pycc import CC

        cc = CC("my_module")
        for func, signature in numba_config:
            globals()[func.__name__] = njit(signature)(func)
            cc.export(func.__name__, signature)(func)
        cc.compile()
        exit()
    elif os.name == "posix":
        exec(
            f"from my_module import {','.join(func.__name__ for func, _ in numba_config)}"
        )
        for func, _ in numba_config:
            globals()[func.__name__] = vars()[func.__name__]
    else:
        from numba import njit

        for func, signature in numba_config:
            globals()[func.__name__] = njit(signature, cache=True)(func)
        print("compiled!", file=sys.stderr)


import sys
import numpy as np


def solve(N, A):
    def osa_k_construct(n_max):
        min_factor = np.arange(n_max + 1)
        for i in range(2, int(n_max**0.5) + 1):
            if min_factor[i] == i:
                for j in range(i * i, n_max + 1, i):
                    if min_factor[j] == j:
                        min_factor[j] = i
        return min_factor

    def osa_k_factorize(min_factor, n):
        min_factor = min_factor
        # n_twoes = (n & -n).bit_length() - 1
        # res = [2] * n_twoes
        # n >>= n_twoes
        res = [0] * 0
        while n > 1:
            p = min_factor[n]
            res.append(p)
            n //= p
        return res

    osa_k = osa_k_construct(1010101)
    Factors = [osa_k_factorize(osa_k, a) for a in A]
    factors = Factors[0]
    st0 = set(factors)  # 0 になれば setwize
    st1 = set(factors)  # 重複しなければ pairwise
    pairwise = True
    for factors in Factors[1:]:
        st = set(factors)
        for f in st:
            if f in st1:
                pairwise = False
            else:
                st1.add(f)
        st0 &= st
    if pairwise:
        print("pairwise coprime")
    elif not st0:
        print("setwise coprime")
    else:
        print("not coprime")


numba_compile([[solve, "void(i8,i8[:])"]])


def main():
    input = sys.stdin.buffer.readline
    N = int(input())
    A = np.array(input().split(), dtype=np.int64)
    solve(N, A)


main()

-from itertools import groupby +def numba_compile(numba_config): +    import os, sys + +    if sys.argv[-1] == "ONLINE_JUDGE": +        from numba import njit +        from numba.pycc import CC + +        cc = CC("my_module") +        for func, signature in numba_config: +            globals()[func.__name__] = njit(signature)(func) +            cc.export(func.__name__, signature)(func) +        cc.compile() +        exit() +    elif os.name == "posix": +        exec( +            f"from my_module import {','.join(func.__name__ for func, _ in numba_config)}" +        ) +        for func, _ in numba_config: +            globals()[func.__name__] = vars()[func.__name__] +    else: +        from numba import njit + +        for func, signature in numba_config: +            globals()[func.__name__] = njit(signature, cache=True)(func) +        print("compiled!", file=sys.stderr) -class Osa_k: -    def __init__(self, n_max): -        self.min_factor = min_factor = list(range(n_max + 1)) +import sys +import numpy as np + + +def solve(N, A): +    def osa_k_construct(n_max): +        min_factor = np.arange(n_max + 1) +        return min_factor -    def __call__(self, n): -        min_factor = self.min_factor -        n_twoes = (n & -n).bit_length() - 1  # 最悪ケースでは速くなる -        res = [2] * n_twoes -        n >>= n_twoes +    def osa_k_factorize(min_factor, n): +        min_factor = min_factor +        # n_twoes = (n & -n).bit_length() - 1 +        # res = [2] * n_twoes +        # n >>= n_twoes +        res = [0] * 0 - -def main(): -    N = int(eval(input())) -    A = list(map(int, input().split())) -    osa_k = Osa_k(1010101) -    Factors = [osa_k(a) for a in A] +    osa_k = osa_k_construct(1010101) +    Factors = [osa_k_factorize(osa_k, a) for a in A] -        st = [] -        for f, _ in groupby(factors): +        st = set(factors) +        for f in st: -            st.append(f) -        st0 &= set(st) +        st0 &= st +numba_compile([[solve, "void(i8,i8[:])"]]) + + +def main(): +    input = sys.stdin.buffer.readline +    N = int(input()) +    A = np.array(input().split(), dtype=np.int64) +    solve(N, A) + +