
def main():
    from itertools import chain
    import sys
    input = sys.stdin.readline

    def gcd(x, y):
        if y == 0:
            return x
        return gcd(y, x % y)
    # 6n+1, 6n-1でも求めて、素数**2+素数*kはふるいおとす
    def prime_set(N):
        """
        Nまでの素数のsetを返す
        """
        if N < 4:
            return ({}, {}, {2}, {2, 3})[N]
        Nsq = int(N ** 0.5 + 0.5) + 1
        primes = {2, 3} | set(chain(range(5, N + 1, 6), range(7, N + 1, 6)))
        for i in range(5, Nsq, 2):
            if i in primes:
                primes -= set(range(i * i, N + 1, i * 2))
        return list(primes)

    def factorization(n, prime_set):
        l = []
        tmp = n
        nsq = int(n ** 0.5 + 0.5) + 1
        for i in prime_set:
            if  i > nsq: 
                break 
            if tmp%i == 0:
                while tmp%i == 0:
                    tmp //= i
                l.append(i)
        if tmp != 1:
            l.append(tmp)
        if l == []:
            if n != 1:
                l.append(n)
        return l
    n = int(input())
    A = [int(x) for x in input().split()]

    # setwise coprimeの条件(1ならOK)
    g = 0
    for a in A:
        g = gcd(g, a)
    # 素数列挙
    num = 10**6+1
    primes = prime_set(num)
    # 全部素因数分解
    prime_list = [0] * (num+1)
    pairwise_f = True
    ll = list()
    for a in A:
        l = []
        tmp = a
        nsq = int(a ** 0.5 + 0.5) + 1
        for i in primes:
            if  i > nsq: 
                break 
            if tmp%i == 0:
                while tmp%i == 0:
                    tmp //= i
                prime_list[i] += 1
                l.append(i)
        if tmp != 1:
            prime_list[tmp] += 1
            l.append(tmp)
        if l == []:
            if a != 1:
                prime_list[n] += 1
                l.append(a)
    if set([0, 1]) != set(prime_list):
        pairwise_f = False
    if pairwise_f:
        print('pairwise coprime')
    elif g == 1:
        print('setwise coprime')
    else:
        print('not coprime')

if __name__ == '__main__':
    main()