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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	int a[n]={};
	
	int prime[n+1];
	for(int i=0;i<n;++i){
		prime[i]=1;
		cin>>a[i];
	}
	prime[n]=1;
	prime[0]=prime[1]=0;
	for(ll i=2;i<=n;++i){
		if(prime[i]){
			for(ll j = i*i;j<=n;j+=i){
				prime[j]=0;
			}
		}
	}
		
	for(int i=0;i<n;++i){
		for(int j=2;j*j<=a[i];++j){
			if(a[i]%j==0){
				while(a[i]%j==0){
					a[i]/=j;
				}
				prime[j]-=1;
			}
		}
		if(a[i]!=1) prime[a[i]]-=1;
	}
	int set=1,pair=1;
	for(int i=0;i<=n;++i){
		if(prime[i]!=0&&prime[i]!=1){
			pair=0;
		}
		if(prime[i]==1-n) set=0;
	}
	if(pair) cout<<"pairwise coprime";
	else if(set) cout<<"setwise coprime";
	else cout<<"not coprime";
	return 0;
}


