#include <bits/stdc++.h>
using namespace std;
#define optimizar_io ios_base::sync_with_stdio(false);cin.tie(0);

typedef long long int ll;
typedef pair<ll,int> factor;
typedef vector<ll> vi;

bitset<10000010> bs;
vi primes;

void sieve(ll upperbound) {
	ll sieveSize = upperbound + 1;
	bs.set();
	bs[0] = bs[1] = 0;
	for (ll i = 2; i <= sieveSize; i++) {
		if (bs[i]) {
			for (ll j = i * i; j <= sieveSize; j += i)
				bs[j] = 0;
			primes.push_back(i);
		}
	}
}

int a[1000010];
map<int,int> cubeta;

vector<factor> primeFactors(ll N) {
	vector<factor> factores;
	ll idx = 0, pf = primes[0];
	while (N != 1 && (pf * pf <= N)) {
		ll power = 0;
		while (N % pf == 0) {
			N /= pf;
			power++;
		}
		if (power) {
			factores.push_back(factor(pf, power));
			cubeta[pf] += power;
		}
		pf = primes[++idx];
	}
	if (N != 1) {
		factores.push_back(factor(N, 1));
		cubeta[N]++;
	}
	return factores;
}

int main() {
	optimizar_io
	int n;
	vector<vector<factor>> pf;

	sieve(1000000);
	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];	
	for (int i = 0; i < n; i++) {
		vector<factor> v = primeFactors(a[i]);
		pf.push_back(v);
	}
	for (int i = 0; i + 1 < n; i++) {
		//Elimino de la cubeta
		for (int j = 0; j < pf[i].size(); j++) {
			cubeta[pf[i][j].first] -= pf[i][j].second;	
			if (cubeta[pf[i][j].first] == 0)
				cubeta.erase(pf[i][j].first);
		}
		bool isPairWise = true;
		for (int j = 0; j < pf[i].size(); j++) {
			if (cubeta.count(pf[i][j].first)) {
				isPairWise = false;
				break;
			}
		}
		if (isPairWise) return cout << "pairwise coprime", 0;
	}
	int gcd = a[0];
	for (int i = 1; i < n; i++) {
		gcd = __gcd(gcd, a[i]);
	}
	if (gcd == 1) return cout << "setwise coprime\n", 0;
	cout << "not coprime\n";
	return 0;
}