import numpy as np
import sys
input = sys.stdin.readline


def get_primes(a=10**6):
    table = np.ones(a+1)
    table[:2] = False
    for i in range(2, a):
        table[i+i::i] = False
    primes = np.where(table==True)[0]
    return primes


def main():
    n = int(input())
    A = np.array(input().split(), dtype=np.int64)
    primes = get_primes(A.max())
    
    if A.max() == 1:
        print("pairwise coprime")

    fact_counts = (A.reshape([1, -1]) % primes.reshape([-1, 1])) == 0
    count = fact_counts.sum(axis=1).max()

    if count == 1:
        print("pairwise coprime")
    elif count != n:
        print("setwise coprime")
    else:
        print("not coprime")


if __name__ == "__main__":
    main()
