"""E."""

import sys
from typing import List


def input() -> str:  # noqa: A001
    """Input."""
    return sys.stdin.readline()[:-1]


RESULT_A = 'pairwise coprime'
RESULT_B = 'setwise coprime'
RESULT_C = 'not coprime'

n = int(input())

a_list = list(map(int, input().split(' ')))


def prime_factors(n: int) -> List[int]:
    """Prime factors."""
    i = 2
    result = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            result.append(i)
    if n > 1:
        result.append(n)
    return result


table = {}

for a in a_list:
    for v in set(prime_factors(a)):
        table[v] = table.get(v, 0) + 1

r = list(table.values())

if [1] * len(r) == r:
    print(RESULT_A)
else:
    for a in a_list:
        if a in table.keys():
            print(RESULT_C)
            break
    else:
        print(RESULT_B)
