#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

from math import gcd

def factorN(n):
    n1 = n + 1
    A = [2, 0] * ((n1+1)//2)
    for i in range(3, n1, 2):
        if A[i]: continue
        for j in range(i, n1, 2*i):
            A[j] = i

    def factor(n):
        if n == 1:
            return [(1, 1)]
        ans = []
        a, i = A[n], 1
        while n > 1:
            n //= a
            b = A[n]
            if a == b:
                i += 1
            else:
                ans.append((a, i))
                a = b
                i = 1

        return ans

    return factor

def resolve():
    it = map(int, sys.stdin.read().split())
    N = next(it)
    A = list(it)
    M = A[-1]
    M1 = M + 1

    dp = [0] * M1

    g1 = A[0]
    f1 = factorN(max(A))
    for i, a in enumerate(A):
        g1 = gcd(g1, a)

        for x, _ in f1(a):
            if dp[x]:
                for i in range(i+1, N):
                    a = A[i]
                    g1 = gcd(g1, a)
                    if g1 == 1:
                        print("setwise coprime")
                        return
                print("not coprime")
                return
            dp[x] = 1

    print("pairwise coprime")

if __name__ == "__main__":
    resolve()
