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

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

ll mp[1000010]={0};

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

    for(i=2;i<=1000000;i++){
        if(mp[i]>1){
            cout<<"setwise coprime"<<nl;
            return;
        }
    }

    for(i=0;i<n;i++){
        x=vc[i];
        for(j=2;j*j<x;j++){
            if(x%j==0){
                mp[j]++;
                mp[x/j]++;
            }
        }
        if(j*j==x) mp[j]++;
    }


    for(i=0;i<n;i++){
        x=vc[i];
        for(j=2;j*j<=x;j++){
            if(x%j==0 && (mp[x/j]>1 || mp[j]>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;
}

