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


int main(){
    vector<bool> primes_vec(MAX+1,true);
    ll div=2;
    while(div*div<=MAX){
        for(ll cnt=div*2; cnt<=MAX; cnt+=div){
            primes_vec[cnt]=false;
        } 
        div++;
        for(;!primes_vec[div];div++){}
    }

    //unordered_set<ll> primes;
    vector<ll> primes;
    vector<bool> factormax(MAX+1,false);
    vector<bool> factormin(MAX+1,false);
    for(ll i=2;i<=MAX;i++){
        if(primes_vec[i]){
            primes.push_back(i);
            factormax[i]=false;
            factormin[i]=true;
        }
    }
    ll n;
    cin >> n;
    bool flgpw = true;
    ll mina=MAX;
    for(ll i=0;i<n;i++){
        ll a;
        cin >> a;
        ll oldmina = mina;
        mina = min(mina,a);
        for(ll j=oldmina; mina<=j; j--) factormin[j]=false;
        for(ll j=0; j<size(primes); j++){
            ll p = primes[j];
            if(p*p>a) break;
            if(a%p==0){
                if(factormax[p])flgpw = false;
                factormax[p]=true;
                while(a%p==0)a/=p;
            }else{
                factormin[p]=false;
            }
        }
    }
    bool flgst = true;
    for(ll j=0; j<size(primes); j++){
        ll p = primes[j];
        if(factormin[p])flgst = false;
    }
    if(flgpw){
        cout << "pairwise coprime";
    }else if(flgst){
        cout << "setwise coprime";
    }else{
        cout << "not coprime";
    }
}