from functools import reduce
def main():

    from math import gcd

    from functools import reduce, lru_cache



    n, *a, = list(map(int, open(0).read().split()))

    m = max(a)



    d = [0] * (m + 1)

    d[1] = 1

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

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

            if d[j] == 0:

                d[j] = i



    @lru_cache()

    def primes(x):

        ps = set()

        while x != 1:

            p = d[x]

            ps.add(p)

            x = x // d[x]

        return ps



    b = set()

    f = 0

    g = a[0]

    for i in range(n):

        x = a[i]

        ps = primes(x)

        g = gcd(g, x)

        if b & ps:

            f = 1

            break

        b |= ps

    if f > 0 and gcd(g, reduce(gcd, a[i:])) != 1:

        f = 2



    ans = ["pairwise coprime", "setwise coprime", "not coprime"][f]

    print(ans)





if __name__ == '__main__':

    main()

def main():

    from math import gcd

    n, *a = list(map(int, open(0).read().split()))

    m = max(a)



    c = [0] * (m + 1)

    g = a[0]

    for i in a:

        g = gcd(g, i)

        c[i] = 1



    if g > 1:

        pre = "not"

    else:

        for i in range(2, 10 ** 6 + 1):

            if sum(c[i::i]) > 1:

                pre = "setwise"

                break

        else:

            pre = "pairwise"



    print((pre + " coprime"))





if __name__ == '__main__':

    main()

from functools import reduce


def main():
    from math import gcd
    from functools import reduce, lru_cache

    (
        n,
        *a,
    ) = list(map(int, open(0).read().split()))
    m = max(a)
    d = [0] * (m + 1)
    d[1] = 1
    for i in range(2, m + 1):
        for j in range(i, m + 1, i):
            if d[j] == 0:
                d[j] = i

    @lru_cache()
    def primes(x):
        ps = set()
        while x != 1:
            p = d[x]
            ps.add(p)
            x = x // d[x]
        return ps

    b = set()
    f = 0
    g = a[0]
    for i in range(n):
        x = a[i]
        ps = primes(x)
        g = gcd(g, x)
        if b & ps:
            f = 1
            break
        b |= ps
    if f > 0 and gcd(g, reduce(gcd, a[i:])) != 1:
        f = 2
    ans = ["pairwise coprime", "setwise coprime", "not coprime"][f]
    print(ans)


if __name__ == "__main__":
    main()

def main():
    from math import gcd

    n, *a = list(map(int, open(0).read().split()))
    m = max(a)
    c = [0] * (m + 1)
    g = a[0]
    for i in a:
        g = gcd(g, i)
        c[i] = 1
    if g > 1:
        pre = "not"
    else:
        for i in range(2, 10**6 + 1):
            if sum(c[i::i]) > 1:
                pre = "setwise"
                break
        else:
            pre = "pairwise"
    print((pre + " coprime"))


if __name__ == "__main__":
    main()

-from functools import reduce - - -    from functools import reduce, lru_cache -    ( -        n, -        *a, -    ) = list(map(int, open(0).read().split())) +    n, *a = list(map(int, open(0).read().split())) -    d = [0] * (m + 1) -    d[1] = 1 -    for i in range(2, m + 1): -        for j in range(i, m + 1, i): -            if d[j] == 0: -                d[j] = i - -    @lru_cache() -    def primes(x): -        ps = set() -        while x != 1: -            p = d[x] -            ps.add(p) -            x = x // d[x] -        return ps - -    b = set() -    f = 0 +    c = [0] * (m + 1) -    for i in range(n): -        x = a[i] -        ps = primes(x) -        g = gcd(g, x) -        if b & ps: -            f = 1 -            break -        b |= ps -    if f > 0 and gcd(g, reduce(gcd, a[i:])) != 1: -        f = 2 -    ans = ["pairwise coprime", "setwise coprime", "not coprime"][f] -    print(ans) +    for i in a: +        g = gcd(g, i) +        c[i] = 1 +    if g > 1: +        pre = "not" +    else: +        for i in range(2, 10**6 + 1): +            if sum(c[i::i]) > 1: +                pre = "setwise" +                break +        else: +            pre = "pairwise" +    print((pre + " coprime"))