#!/usr/bin/env python3
def main():
    from itertools import combinations

    def prime_factorization_turple(n: int):
        """
        入力された整数nを素因数分解し，タプルを要素とするリストで返却
        Parameters
        ----------
        n : int
            素因数分解したい整数
        Returns
        -------
        prime_factorization_lst : lst
            [(素因数,累乗)]の形で素因数が列挙された素因数分解結果
        """
        fct = set()     # prime factor
        b, e = 2, 0  # base factor
        while b * b <= n:
            while n % b == 0:
                n //= b
                e += 1
            if e > 0:
                fct.add(b)
            b += 1
            e = 0
        if n > 1:
            fct.add(n)
        return fct

    _ = int(input())
    A = sorted([int(x) for x in input().split()])

    # Aの素因数分解
    fac_A = [prime_factorization_turple(a) for a in A]

    # pairwiseの判定
    pairwise_coprime = True
    for a, b in combinations(fac_A, 2):
        for i in a:
            if i in b:
                pairwise_coprime = False
                break
        if pairwise_coprime is False:
            break

    # setwise
    setwise_coprime = True
    for b in fac_A[0]:
        cnt = 0
        for a in A:
            if a % b == 0:
                cnt += 1
        if cnt == len(A):
            setwise_coprime = False
            break

    if pairwise_coprime:
        print('pairwise coprime')
    elif setwise_coprime:
        print('setwise coprime')
    else:
        print('not coprime')


if __name__ == '__main__':
    main()
