#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#define MOD 1000000007
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define all(v) (v).begin() , (v).end()
#define sumof(v) accumulate(all(v), 0LL, plus<ll>())
#define maxof(v) max_element(all(v))
#define minof(v) min_element(all(v))
#define inf INT_MAX

ll lcm(int a, int b){
    return (a*b)/__gcd(a,b);
}

bool pairwiseCoprime(vector<ll> A){
    if(A.size()==1) return true;
    ll current = lcm(A[0], A[1]);
    ll pro = A[0]*A[1];
    for(int i=2; i<A.size(); ++i){
        current = lcm(current, A[i]);
        pro = pro*A[i];
    }
    if(pro==current) return true;
    return false;
}

bool setwiseCoprime(vector<ll> A){
    ll current = __gcd(A[0], A[1]);
    for(int i=2; i<A.size(); ++i) current = __gcd(current, A[i]);
    return current==1;
}

int main(){
    FASTIO
    int testCases = 1;
    // cin>>testCases;
    while(testCases--){
        ll N; cin>>N;
        vector<ll> A(N);
        for(int i=0; i<N; ++i) cin>>A[i];
        if(pairwiseCoprime(A)){
            cout<<"pairwise coprime"<<endl;
        }
        else if(setwiseCoprime(A)){
            cout<<"setwise coprime"<<endl;
        }
        else{
            cout<<"not coprime"<<endl;
        }
    }
}