# -*- coding: utf-8 -*-
import sys


def main():
    N = int( sys.stdin.readline() )
    A_list = list(map(int, sys.stdin.readline().split()))


    def get_factor(n :int) -> list:
        ans = set()
        
        for i in range(2, int(n**(1/2)+1) ):  # exclude "factor 1" and "max factor"
            if  n % i == 0:
                ans.add(i)
                
                d = n / i
                if (d != i) and (d % 1 == 0):
                    ans.add( int(d) )
        
        return ans


    factor = [None] * N

    for i in range(N):
        factor[i] = get_factor( A_list[i] )
    

    for i in range(1, N):
        f1 = factor[i-1] | {A_list[i-1]}
        f2 = factor[i] | {A_list[i]}
        common = f1 & f2

        if common:
            break
    
    else:
        print("pairwise coprime")
        return


    f = factor[0] | {A_list[0]}

    for i in range(1, N):
        f &= ( factor[i] | {A_list[i]} )
    
    
    if (not f):
        print("setwise coprime")
    else:
        print("not coprime")


if __name__ == "__main__":
    main()
