from collections import defaultdict
def sieve(n):
    is_prime = [True] * (n+1)
    divisors = [set() for _ in range(n+1)]
    is_prime[0] = False
    is_prime[1] = False

    p = 0
    for i in range(2,n+1):
        divisors[i].add(i)
        if is_prime[i]:
            p = i
            for j in range(p+p, n+1, p):
                divisors[j].add(i)
                is_prime[j] = False
        
        if p * p > n:
            break
    
    primes = []
    for i in range(2,n+1):
        if is_prime[i]:
            primes.append(i)

    return primes, divisors

def solve():
    N = int(input())
    A = list(map(int,input().split()))

    # primes, divisors = sieve(max(A))
    primes, divisors = sieve(10**6)
    divisors_counter = defaultdict(int)

    is_pairwise = True
    for a in A:
        for d in divisors[a]:
            if divisors_counter[d] != 0:
                is_pairwise = False
            divisors_counter[d] += 1
    
    if is_pairwise:
        print('pairwise coprime')
        return
    
    if list(divisors_counter.values()).count(N) == 0:
        print('setwise coprime')
    else:
        print('not coprime')
        
if __name__ == '__main__':
    solve()
