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

template <typename T> 
map<T, T> prime_factorize(const T n) {
	
	map<T, T> primes;
	
	if(n < 1) return primes;
	
	if(n == 1) {
		primes.emplace(1, 1);
		return primes;
	}
	
	T k = n;
	for(T i=2; i<=k && i*i<=n; i++) {
		uint cnt = 0;
			while(k % i == 0) {
				cnt++;
				k /= i;
			}
			
		if(cnt > 0) primes[i] = cnt;
	}
		
	if(k != 1) primes[k] = 1;
	
	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);
	boost::dynamic_bitset<> is_set_wise_bits(amax);
	is_set_wise_bits.set();
	is_set_wise_bits.reset(0);

	for(u64 i=0; i<N; i++) {
		map<u64, u64> pmap = prime_factorize(A[i]);
		boost::dynamic_bitset<>  primes(amax);

		for(const auto& p : pmap) {
			is_pair_wise &= !is_pair_wise_bits[p.first - 1];
			primes.set(p.first - 1);
		}

		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;
}