#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
const ll mod=1000000007;
const char nl='\n';

void solve(){
    ll i,j,k,l,m,n,u,v,x,y;
    cin>>n;
    vector<ll> vc(n);
    ll gcd;
    cin>>gcd;
    vc[0]=gcd;
    for(i=1;i<n;i++){
        cin>>vc[i];
        gcd=__gcd(gcd,vc[i]);
    }
    if(gcd!=1){
        cout<<"not coprime"<<nl;
        return;
    }
    gcd=vc[n-1];
    for(i=n-2;i>=0;i--){
        gcd=__gcd(gcd,vc[i]);
        if(gcd!=1){
            cout<<"setwise coprime"<<nl;
            return;
        }
    }
    if(gcd!=1){
        cout<<"setwise coprime"<<nl;
        return;
    }
    cout<<"pairwise coprime"<<nl;

}

int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	int t = 1,i=1;
//    cin >> t;
	while (t--)
	{
//	    cout<<"Case #"<< i++ <<": ";
		solve();
	}
	return 0;
}

