def main():

    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



    def primes(x):

        ps = set()

        while x != 1:

            p = d[x]

            ps.add(p)

            x = x // d[x]

        return ps



    b = set()

    c = primes(a[0])

    f = 0

    for i in a:

        ps = primes(i)

        if f == 0:

            if b & ps:

                f = 1

            b |= ps

        c &= ps

    else:

        if f == 1 and len(c) > 0:

            f = 2

    

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

    print(ans)





if __name__ == '__main__':

    main()

from functools import reduce
def main():

    from math import gcd

    from functools import reduce

    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



    def primes(x):

        ps = set()

        while x != 1:

            p = d[x]

            ps.add(p)

            x = x // d[x]

        return ps



    b = set()

    f = 0

    for i in a:

        ps = primes(i)

        if b & ps:

            f = 1

            break

        b |= ps

    if f > 0 and reduce(gcd, a) != 1:

        f = 2



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

    print(ans)





if __name__ == '__main__':

    main()

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

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

    b = set()
    c = primes(a[0])
    f = 0
    for i in a:
        ps = primes(i)
        if f == 0:
            if b & ps:
                f = 1
            b |= ps
        c &= ps
    else:
        if f == 1 and len(c) > 0:
            f = 2
    ans = ["pairwise coprime", "setwise coprime", "not coprime"][f]
    print(ans)


if __name__ == "__main__":
    main()

from functools import reduce


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

    (
        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

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

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


if __name__ == "__main__":
    main()

+from functools import reduce + + +    from math import gcd +    from functools import reduce + -    c = primes(a[0]) -        if f == 0: -            if b & ps: -                f = 1 -            b |= ps -        c &= ps -    else: -        if f == 1 and len(c) > 0: -            f = 2 +        if b & ps: +            f = 1 +            break +        b |= ps +    if f > 0 and reduce(gcd, a) != 1: +        f = 2