#include <bits/stdc++.h>
using namespace std;

using ll = long long;
const int INF = 1e9+100;
const int S = 1e3+5;

vector<int> pr;
vector<int> isp(S, 1);
void sieve(){
	for (int p = 2; p < S; p++){
		if (isp[p]){
			pr.push_back(p);
			for (int j = p*2; j < S; j += p){
				isp[j] = 0;
			}
		}
	}
}

int n;
vector<int> a;
bool f1(){
	vector<int> occ(S, 0);
	for (auto it: a){
		for (auto p: pr){
			if (it % p == 0){
				if (occ[p]){
					return 0;
				}
				occ[p]++;
				while (it % p == 0){
					it /= p;
				}
			}
		}
		if (it != 1){
			if (occ[it]){
				return 0;
			}
			occ[it]++;
		}
	}
	return 1;
}
bool f2(){
	int allGCD = a[0];
	for (int i = 1; i < n; i++){
		allGCD = __gcd(allGCD, a[i]);
	}
	return allGCD == 1;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	
	sieve();
	// cout<<pr.size()<<'\n';
	// for (int i = 0; i < 5; i++){
	// 	cout<<pr[i]<<'\n';
	// }

	cin>>n;
	a.resize(n);
	for (int i = 0; i < n; i++){
		cin>>a[i];
	}
	if (f1()){
		cout<<"pairwise coprime\n";
	}else if (f2()){
		cout<<"setwise coprime\n";
	}else{
		cout<<"not coprime\n";
	}
	return 0;
}