from math import sqrt
from math import ceil
def mpfli(N): #minimum prime factor listのこと
    li = [i for i in range(N+1)]
    li2 = [i for i in range(N+1)]
    for i in range(2,ceil(sqrt(N+1))):
        for j in range(2*i, N + 1):
            if li[j]== li2[j]:
                if li[j] % li[i] == 0:
                    li[j] = li[i]
    return li


def pfac(n): #mpf = mpfli(N+1)
    S = set()
    while n != 1:
        m = mpf[n]
        S = S.union({m})
        n = n // m
    return S


def paerwise_coprime(A):
    for i in range(len(A)):
        for j in range(i + 1, len(A)):
            if pfac(A[i]) & pfac(A[j]) != {}:
                return False
            else:
                return True


def setwise_coprime(A):
    S = pfac(A[0])
    for i in range(1, len(A)):
        S = S & pfac(A[i])
    if S != {}:
        return False
    else:
        return True


def main():
    N = input()
    mpf = mpfli(N+1)
    A = list(map(int, input().split()))
    if pairwise_coprime(A):
        print('pairwise coprime')
    elif setwise_coprime(A):
        print('setwise coprime')
    else:
        print('not coprime')


main()