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

#define ll long long 
#define pll pair<ll,ll> 

const ll N=1e6+5;
	ll B[N];
	vector<ll> C[N];
int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	for(ll i=2;i<N;i++){
		if(B[i]==0)
			for(ll j=2*i;j<N;j+=i){
				B[j]=1;
				C[j].push_back(i);
			}
	}

	ll n;
	cin>>n;
	ll A[n];
	set<ll> S;
	ll flag=0;
	cin>>A[0];
	ll g=A[0];
	for(ll i=1;i<n;i++){
		cin>>A[i];
		g=__gcd(g, A[i]);
	}

	for(ll i=n-1;i>=0;i--){
		for(auto it:C[A[i]]){
			if(S.count(it)){
				flag=1;
			}
			else S.insert(it);
		}
		if(flag)
			break;
	}
	if(flag==0)
		cout<<"pairwise coprime";
	if(g==1)
		cout<<"setwise coprime";
	else
		cout<<"not coprime";


}
