#include <bits/stdc++.h>

using namespace std;
const int maxn = 1000001;
int c[maxn], mark[maxn];
int main(){
	int n; cin >> n;
	int a[n];
	memset(c, 0, sizeof c);
	bool not_pairwise = false;
	vector<int> v;

	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i] != 1) v.push_back(a[i]);
	}

	n = v.size();
	for(int i = 0; i < n; i++) {
		c[v[i]]++;
		if(c[v[i]] > 1) not_pairwise = true;
	}
	if(n == 0) {
		cout << "pairwise coprime\n";
		return 0;
	}
	int g = v[0];
	for(int i = 1; i < n; i++) {
		g = __gcd(v[i], g);
	}

	if(!not_pairwise)
	{
		memset(mark, 0, sizeof mark);
		for(int i = 2; i * i < maxn; i++) {
			if(mark[i]) continue;
			int cnt = 0;
			for(int j = i; j < maxn; j+=i) {
				if(!mark[j]) cnt++;
				mark[j] = 1;
			}	
			if(cnt > 1) {
				not_pairwise = true;
			}
		}
	}

	if(!not_pairwise) {
		cout << "pairwise coprime\n";
	}else {
		if(g == 1) {
			cout << "setwise coprime\n";
		}else cout <<"neither\n";
	}


	
	return 0;
}
