from functools import reduce
import fractions
import sys
sys.setrecursionlimit(10**9)

class Osak:
    def __init__(self,maxim): #O(Nlog(log N))
        spf = [0] * (maxim+1)
        for i in range(maxim):
            spf[i] = i
        
        i = 2
        while i*i <= maxim:
            if spf[i] != i: i += 1; continue
            j = i*i
            while j <= maxim:
                if spf[j] != j: j += i; continue
                spf[j] = i
                j += i
            
            i += 1

        self.spf = spf

    def get(self,n): # O(log n)
        m  = set()
        while n > 1:
            m.add(self.spf[n])
            n //= self.spf[n]

        return m



def get_gcm(X):
    return reduce(lambda x,y: fractions.gcd(x, y), X[1:], X[0])


INF=10**20
def solve(N: int, A: "List[int]"):
    osak = Osak(10**6+10)

    pairwise = True
    allP = set()
    for a in A:
        P = osak.get(a)
        no_collapse = len(allP) + len(P)
        for p in P:
            allP.add(p)
        
        res = len(allP)
        if no_collapse != res:
            pairwise = False
            break




    if pairwise:
        print("pairwise coprime")
    else:
        gcm = get_gcm(A)
        if gcm == 1:
            print("setwise coprime")
        else:
            print("not coprime")

    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)



if __name__ == "__main__":
    main()
