# In[]:
import math
from functools import reduce


# In[]:
def gcd_list(numbers):
    return reduce(math.gcd, numbers)


# In[]:
N = int(input())
input_str = input()
input_list = input_str.split()
input_int = [int(x) for x in input_list]


# In[]:
def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    # print(data)
    for i in range(limit):
        p = data[0]
        prime += [p]
        # print(prime)
        data = [e for e in data if e % p != 0]
        if limit <= p:
            # print(limit, p)
            return prime + data


# In[]:
max_num = max(input_int)
print(max_num)
prime_list = get_sieve_of_eratosthenes(max_num)
print(prime_list)


# In[]:
def factorization(x):
    return [p for p in prime_list if x % p == 0]


# In[]:
factor_list = [factorization(x) for x in input_int]
print(factor_list)
c3 = list(set(factor_list[0]).intersection(factor_list[1]))
print(c3)

# In[]:
gcd_all = gcd_list(input_int)
if gcd_all != 1:
    print('not coprime')
else:
    flag = 0
    for idx, i in enumerate(input_int):
        for j in range(idx+1, N):
            if len(list(set(factor_list[idx])\
                .intersection(factor_list[j]))) != 0:
                flag = 1
                break
        else:
            continue
        break
    if flag == 1:
        print('setwise coprime')
    elif flag == 0:
        print('pairwise coprime')