//Use valgrind once if the submission doesn't go through. It can detect uninitialized variables and see where they could be an issue.
#include <bits/stdc++.h>
#include <numeric>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int main(){

	ios_base::sync_with_stdio(false);
    	cin.tie(NULL);

	int n,tgcd;
	bool pair=true;
	array<bool,1000001> primes,chosen;
	vector<int> a;
	list<int> toc;
	fill(primes.begin(),primes.end(),true);
	primes[0]=primes[1]=false;
	for(int i=2;i<=1000000;++i){
		if(!primes[i]) continue;
		for(int j=2;j*i<=1000000;++j){
			primes[i*j]=false;
		}
	}
	for(int i=0;i<1000;++i){
		if(primes[i]){
			toc.push_back(i);
		}
	}
	cin>>n;
	a.resize(n);
	for(auto &i:a){
		cin>>i;
	}
	tgcd=*a.rbegin();
	for(int i=a.size()-1;i>=0;--i){
		tgcd=gcd(tgcd,a[i]);
		if(primes[a[i]]&&chosen[a[i]]){
			pair=false;
		}
		else if(primes[a[i]]){
			chosen[a[i]]=true;
			list<int>::iterator it=toc.begin();
			while(a[i]<1000&&*it!=a[i]){++it;}
			it=toc.erase(it);
		}
		else if(pair){
			list<int>::iterator it=toc.begin();
			while(it!=toc.end()){
				if(a[i]%*it==0){
					chosen[*it]=true;
					while(a[i]%*it==0) a[i]/=*it;
					it=toc.erase(it);
				}
				else{
					++it;
				}
			}
			if(a[i]==1||(primes[a[i]]&&!chosen[a[i]])){
				chosen[a[i]]=true;
			}
			else{
				pair=false;
			}
		}
	}
	if(pair){
		cout<<"pairwise coprime"<<endl;
	}
	else if(tgcd==1){
		cout<<"setwise coprime"<<endl;
	}
	else{
		cout<<"not coprime"<<endl;
	}
}
