import sys
import math
from io import StringIO
import unittest


def resolve():
    N, = map(int, input().split())
    As = list(map(int, input().split()))
    # allprimes = []
    common_primes = None
    all_primes = set()
    all_uniq_primes_n = 0
    d = get_d(1100000)
    for i, a in enumerate(As):

        primes = get_primes_fast(a, d, set())
        # print(f'a {a} primes:{primes}')
        all_uniq_primes_n += len(primes)
        all_primes = all_primes | primes
        if i == 0:
            common_primes = primes
        else:
            # print(f'bef {common_primes} primes:{primes}')
            common_primes = primes & common_primes
            # print(f'aft {common_primes}')

    if len(common_primes) > 0:

        print('not coprime')

    elif all_uniq_primes_n == len(all_primes):
        print('pairwise coprime')
    else:
        print('setwise coprime')


def get_primes_fast(a, d, primes):
    is_div = False
    if a==1:
        return primes
    if d[a] != a:
        is_div = True
        primes.add(d[a])
        get_primes_fast(int(a / d[a]), d, primes)
    if not is_div:
        primes.add(a)
    return primes


def get_primes(a, start_n, primes):
    is_div = False
    for i in range(start_n, math.floor(math.sqrt(a) + 1)):
        if a % i == 0:
            is_div = True
            primes.add(i)
            get_primes(int(a / i), i, primes)
    if not is_div:
        primes.add(a)
    return primes


def get_d(A):
    d = [0] * (A + 1)
    d[1]=1
    for i in range(2, A + 1):
        for k in range(1, int(A / i)):
            if d[i * k] == 0:
                d[i * k] = i
    return d


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(output, out)

    def test_入力例_1(self):
        input = """3
1 4 49"""
        output = """pairwise coprime"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3
6 10 15"""
        output = """setwise coprime"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """3
6 10 16"""
        output = """not coprime"""
        self.assertIO(input, output)


if __name__ == "__main__":
    resolve()
    # unittest.main()
