//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>
#define MOD1 1000000007
#define MOD2 998244353
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>;
long long power(long long x,long long y,long long MOD){
	if(y==0){
		return 1;
	}
	else if(y&1){
		return (x*power(x,y-1,MOD))%MOD;
	}
	else{
		long long t=power(x,y/2,MOD);
		return (t*t)%MOD;
	}
}
int main(){

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

	long long n,prod1,tgcd,prod2;
	cin>>n;
	vector<long long> a(n);
	bool p=true;
	for(auto &i:a){
		cin>>i;
	}
	prod1=prod2=tgcd=a[0];
	for(int i=1;i<a.size();++i){
		long long l1,l2;
		tgcd=gcd(tgcd,a[i]);
		l1=prod1*a[i];
		l2=prod2*a[i];
		l1%=MOD1;
		l2%=MOD2;
		l1*=power(tgcd,MOD1-2,MOD1);
		l2*=power(tgcd,MOD2-2,MOD2);
		l1%=MOD1;
		l2%=MOD2;
		prod1*=a[i];
		prod2*=a[i];
		prod1%=MOD1;
		prod2%=MOD2;
		if(prod1!=l1||prod2!=l2){
			p=false;
		}
	}
	if(p){
		cout<<"pairwise coprime"<<endl;
	}
	else if(tgcd==1){
		cout<<"setwise coprime"<<endl;
	}
	else{
		cout<<"not coprime"<<endl;
	}
}
