#include<bits/stdc++.h>
using namespace std ;
#define ll long long 
#define pb push_back
#define in(x) ll x; cin>>x;
#define ln(x) long long x; cin>>x;
#define memf(a) memset(a,false,sizeof(a))
#define F first
#define S second
#define endl "\n"
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ll power(ll b,ll e,ll m)
{
	if(e==0) return 1;
	if(e&1) return b*power(b*b%m,e/2,m)%m;
	return power(b*b%m,e/2,m);
}
ll power( ll b, ll e)
{
	if(e==0) return 1;
	if(e&1) return b*power(b*b,e/2);
	return power(b*b,e/2);
}
vector<set<ll>> v;
vector<ll> vv;
bool prime[1000001];
ll a[1000001];
void SieveOfEratosthenes(ll n) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    memset(prime, true, sizeof(prime)); 
  
    for (ll p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (ll i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Prll all prime numbers 
    for (ll p=2; p<=n; p++) 
       if (prime[p]) vv.pb(p);
} 
int main()
{
	fast
	SieveOfEratosthenes(1e6);
	ll n;
	cin>>n;
	ll o;
	set<ll> s;
	for(ll i=0;i<n;i++)
	{
		cin>>a[i];
		s.insert(a[i]);
		if(i==0)
			o=a[i];
		else
			o=__gcd(o,a[i]);
	}
	if(s.size()!=n)
	{
		if(o==1)
			cout<<"setwise coprime";
		else
			cout<<"not coprime";
		return 0;
	}
	v.resize(1e6+1);
	ll f=1;
	for(auto i:vv)
	{
		for(ll j=i;j<=1e6;j+=i)
			{
				v[j].insert(i);
			}
			
	}
	set<ll> xx;
	ll zz=0;
	for(ll i=0;i<n;i++)
	{
		zz+=v[a[i]].size();
		for(auto j:v[a[i]])
			xx.insert(j);
	}
	if(zz==xx.size())
		f=1;
	else
		f=0;
	if(f)
		cout<<"pairwise coprime";
	else
	{
		if(o==1)
			cout<<"setwise coprime";
		else
			cout<<"not coprime";

	}
	return 0;
}