#import sympy
#import random

def get_ans():
    N = int(input())
    A_list = [int(e) for e in input().split()]

    #テスト用乱数生成
    
    #N = 10**6
    #A_list = [random.randrange(1,10**6) for _ in range(N)]

    #約数を列挙
    def make_divisors(n):
        lower_divisors , upper_divisors = [], []
        i = 1
        while i*i <= n:
            if n % i == 0:
                lower_divisors.append(i)
                if i != n // i:
                    upper_divisors.append(n//i)
            i += 1
        return lower_divisors + upper_divisors[::-1]
        
    divisors_dict = dict()

    for A in set(A_list):
        divisors_dict[A] = set(make_divisors(A))

    all_divisors = set()
    common_divisors = set()
    common_divisors |= divisors_dict[A_list[0]]
    all_divisors |= divisors_dict[A_list[0]]
    is_pairwise = True

    for i in range(1,len(A_list)):
        A_divisors = divisors_dict[A_list[i]]
        common_divisors &= A_divisors 
        
        if is_pairwise and len(all_divisors&A_divisors)!=1:
            is_pairwise = False
        else:
            all_divisors |= A_divisors
        
    #約数を全部積み重ねて、共通のものが1以外に全くなかったらpaiwise
    #全部に含まれる約数が、1以外になければ、setwise

    if is_pairwise:
        print("pairwise coprime")
    elif len(common_divisors) == 1:
        print("setwise coprime")
    else:
        print("not coprime")

get_ans()