#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define PI 2 * acos(0.0)
#define MAX 1000000
#define INF 1000000 
#define M 1000000007
using namespace std;
ll gcdarray(ll a[],ll n){
    ll a1 = a[0];
    ll b1 = a[1];
    ll ans = __gcd(a1,b1);
    for(ll i = 2;i<n;i++){
        ans = __gcd(a[i],ans);
    }
    return ans;
}
int main(){
    FAST
    ll n;
    cin>>n;
    ll a[n];
    map<ll,ll> mp;
    ll even = 0;
    for(ll i = 0;i<n;i++){
        cin>>a[i];
        mp[a[i]]++;
        if(a[i]%2 == 0) even++;
    }
    if(even >= 2){
        ll y = gcdarray(a,n);
        if(y == 1){
            cout<<"setwise coprime"<<endl;
        }
        else{
            cout<<"not coprime"<<endl;
        }
    }
    else{
        bool ok = true;
        sort(a,a+n);
        for(ll i = 1;i<n;i++){
            if(a[i] == a[i-1] && a[i] != 1){
               ok = false;
            }
        }
        for(ll i = 2;i<=1000000;i++){
            if(mp[i] > 0){
                for(ll j = i*2;j<=1000000;j+=i){
                     if(mp[j] > 0){
                         ok = false;
                     }
                }
            }
        }
        ll y = gcdarray(a,n);
        if(ok == true){
            cout<<"pairwise coprime"<<endl;
        }
        else if(y == 1){
            cout<<"setwise coprime"<<endl;
        }
        else{
            cout<<"neither"<<endl;
        }
    }
}
