#include<bits/stdc++.h>
#include<boost/dynamic_bitset.hpp>
using namespace std;
using u64 = uint64_t;
using s64 = int64_t;

template <typename T> 
boost::dynamic_bitset<> prime_factorize(const T n) {
	
	boost::dynamic_bitset<> primes;
	
	if(n < 1) return primes;
	
	primes.resize(n+1);

	if(n == 1) {
		primes.set(1);
		return primes;
	}
	
	T k = n;
	for(T i=2; i<=k && i*i<=n; i++) {
		while(k % i == 0) {
			k /= i;
			primes.set(i);
		}
	}
		
	if(k != 1) primes.set(k);
	
	return primes;
}

int main() {
	u64 N;
	cin >> N;

	vector<u64> A(N);
	u64 amax = 0;

	for(u64 i=0; i<N; i++) {
		cin >> A[i];
		amax = max(amax, A[i]);
	}

	bool is_pair_wise = true;
	boost::dynamic_bitset<> is_pair_wise_bits(amax+1);
	boost::dynamic_bitset<> is_set_wise_bits(amax+1);
	is_set_wise_bits.set();
	is_set_wise_bits.reset(0);
	is_set_wise_bits.reset(1);

	for(u64 i=0; i<N; i++) {
		boost::dynamic_bitset<>  primes = prime_factorize(A[i]); 
		primes.resize(is_pair_wise_bits.size());

		boost::dynamic_bitset<> dep = is_pair_wise_bits & primes;
		is_pair_wise &= (dep.count() == 0);

		is_pair_wise_bits = is_pair_wise_bits | primes;
		is_set_wise_bits = is_set_wise_bits  & primes;
	}

	bool is_set_wise = (is_set_wise_bits.count() == 0);

	if(is_pair_wise) {
		cout << "pairwise coprime" << endl;
	} else if(is_set_wise) {
		cout << "setwise coprime" << endl;
	} else {
		cout << "not coprime" << endl;
	}

	return 0;
}