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

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const ll mxx=2e5+7;

 int a[1200005]={};
  vector<int> pr;
void primes(int n)
{
	 for(int i=2;i<=n;i++)
	 {     
	   if(a[i]==0)
	   {
	     a[i]=i;pr.push_back(i);
	   }
	   for(int j=0;j<(int)pr.size() && pr[j]<=a[i] && i*pr[j]<=n;j++)
	    a[pr[j]*i]=pr[j];
	 }  
}


int main()
{
    fast
   
    primes(1100001);a[1]=1;
     int n;
     cin>>n;
     int gc=1;int aa[n];
     for(int i=0;i<n;i++)
     {
     	 cin>>aa[i];
     	 if(i==0)gc=aa[i];
     	 else gc=__gcd(gc,aa[i]);
     }
     
     bool ok=false;
     if(gc==1)ok=true;

     bool what=true;
     map<int,int> m;
     for(int i=0;i<n;i++)
     { 
     	   int num=aa[i];
     	   if(!what)break;
     	   set<int> cur;
     	   while(num!=a[num])
     	   {
     	   	 cur.insert(num);
     	   	 num=a[num];
     	   }
     	   if(num!=1)cur.insert(num);
     	   	 for(auto x:cur)if(m[x]>0 && x>1){what=false;break;}
     	   	 	else m[x]++;
     }
     
     	 if(what)cout<<"pairwise coprime";
     	 else if(ok)cout<<"setwise coprime";
     	 else cout<<"not coprime";
     

}