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
        self.m = set()

    def query(self,n): # O(log n)
        while n > 1:
            if self.spf[n] in self.m: return False
            self.m.add(self.spf[n])
            while n > 1 and n % self.spf[n] == 0:
                n //= self.spf[n]


        return True

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
    for a in A:
        pairwise = osak.query(a)
        if not pairwise: 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()
