	#include <bits/stdc++.h>
#include<string.h>
#define ll long long 
#include<vector>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int mod=1e9+7; 
const int max_n=1000006;
bool vis[1000006];
bool sieve[1000006];
void build_sieve(int i){
	
	if(vis[i])
	return;
	if(sieve[i]==false)
	return;
	vis[i]=true;
    
	int start=2*i;
	for(int j=start;j<=max_n;j+=i)
	{
		
		sieve[j]=false;
		
	}
}
void find_factors(int n){
	
	for(int i=2;i*i<=n;i++){
		if(n%i==0){
			build_sieve(i);
		    while(n%i==0){
		    	n/=i;
			}
		}
	}
	if(n!=1)
	{
	
	build_sieve(n);}
}
int main(){

	memset(sieve, true, sizeof(sieve));
	memset(vis,false, sizeof(vis));
	bool pair_wise=true;
	bool set_wise=true;
	int n;
	cin>>n;
	vector<int> a(n);
	for(int i=0;i<n;i++)
	cin>>a[i];
	
	for(int i=0;i<n;i++){
	if(a[i]==1)
	continue;
	if(sieve[a[i]]==false){
		//cout<<vis[i]<<sieve[i];
		pair_wise=false;
	}
	
	else{
	
		find_factors(a[i]);
	}
}

    int overall_gcd=0;
    for(int i=0;i<n;i++){
    	overall_gcd=__gcd(overall_gcd,a[i]);
    	if(overall_gcd==1)
    	break;
	}
	if(overall_gcd!=1)
	set_wise=false;
	if(pair_wise==true)
	cout<<"pairwise coprime";
	else if(set_wise==true)
	cout<<"setwise coprime";
	else
	cout<<"not coprime";

}
	
	if(sieve[i]==false)
	return;
	vis[i]=true;
    
	int start=2*i;
	for(int j=start;j<=max_n;j+=i)
	{
		
		sieve[j]=false;
		
	}
}
void find_factors(int n){
	
	for(int i=2;i*i<=n;i++){
		if(n%i==0){
			build_sieve(i);
		    while(n%i==0){
		    	n/=i;
			}
		}
	}
	if(n!=1)
	{
	
	build_sieve(n);}
}
int main(){

	memset(sieve, true, sizeof(sieve));
	memset(vis,false, sizeof(vis));
	bool pair_wise=true;
	bool set_wise=true;
	int n;
	cin>>n;
	vector<int> a(n);
	for(int i=0;i<n;i++)
	cin>>a[i];
	
	for(int i=0;i<n;i++){
	if(a[i]==1)
	continue;
	if(sieve[a[i]]==false){
		//cout<<vis[i]<<sieve[i];
		pair_wise=false;
	}
	
	else{
	
		find_factors(a[i]);
	}
}

    int overall_gcd=0;
    for(int i=0;i<n;i++){
    	overall_gcd=__gcd(overall_gcd,a[i]);
    	if(overall_gcd==1)
    	break;
	}
	if(overall_gcd!=1)
	set_wise=false;
	if(pair_wise==true)
	cout<<"pairwise coprime";
	else if(set_wise==true)
	cout<<"setwise coprime";
	else
	cout<<"not coprime";

}