/*  CREATED BY
    STREAM_CIPHER
    29-aug-2020
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define double long double
#define debug1(a) cout<<#a<<"="<<(a)<<"\n"
#define debug2(a,b) cout<<#a<<"="<<(a)<<","<<#b<<"="<<(b)<<"\n"
#define debug3(a,b,c) cout<<#a<<"="<<(a)<<","<<#b<<"="<<(b)<<","<<#c<<"="<<(c)<<"\n"
#define fix_precision(n) cout << fixed << setprecision(n)
#define all(a) a.begin(),a.end()
const double pi=acos(-1.0);
int inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int mx=5*1000000;
int cpd[2000000];
void SieveOfEratosthenes(int n) 
{ 
    memset(cpd,0,sizeof cpd);
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        {
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          cpd[p]=p;
    for(int i=2;i<=n;i++)
    {
        if(cpd[i]==i)
        {
            for(int j = 2*i;j<=n;j+=i)
            {
                cpd[j]=i;
            }
        }
    }
} 
vector<int> find(int n)
{
	vector<int>ans;
	unordered_map<int,int>cnt;
	while(n!=1)
	{
		cnt[cpd[n]]++;
		if(cnt[cpd[n]]==1)
			ans.push_back(cpd[n]); 
		n = n / cpd[n]; 
	}
	return ans;
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        // freopen("output.txt","w",stdout);
    #endif
        SieveOfEratosthenes(500000);
        int n;
        cin>>n;
        vector<int>a(n);
        for(auto &i:a)
        	cin>>i;
        map<int,int>div;
        vector<int>ff=find(a[n-1]);
        for(auto i:ff)
        	div[i]=1;
        bool ok1=true;
        for(int i=n-2;i>=0;i--)
        {
        	vector<int>ff2=find(a[i]);
        	for(auto j:ff2)
        	{
        		if(div[j]!=0)
        		{
        			ok1=false;
        			break;
        		}
        	}
        	if(!ok1)
        		break;
        	else
        	{
        		for(auto j:ff2)
	        	{
	        		div[j]=1;
	        	}
        	}
        }
        if(ok1)
        {
        	cout<<"pairwise coprime\n";
        	return 0;
        }
        int gg=a[0];
        for(auto i:a)
        {
        	// cout<<i<<" ";
        	gg=gcd(gg,i);
        	// debug1(gg);
        }
        if(gg==1)
        	cout<<"setwise coprime\n";
        else
        	cout<<"not coprime\n";

}