#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<vector>
#include<numeric>
#include<set>
#include<algorithm>
using namespace std;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
#define rep(i, n) for (i32 i = 0; i < (i32)(n); ++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using P = pair<i64,i64>;
int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    i32 n;
    cin >> n;
    vector<i32> a(n);
    i32 lim = 0;
    set<i32> st;
    rep(i,n){
        cin >> a[i];
        lim = max(lim,a[i]);
        st.insert(a[i]);
    }
    if(st.size() < n){
        i32 cnt = 0;
        i32 k = a[0];
        for(i32 i = 0; i < n; i++){
            k = gcd(a[i],k);
        }
        if(k == 1){
            cout << "setwise coprime" << endl;
        }else{
            cout << "not coprime" << endl;
        }
        return 0;
    }
    vector<i32>rec(lim + 1,0);
    reverse(all(a));
    bool as = true;
    rep(i,n){
        if(a[i] != 1) {
            bool flag = true;
            for (i32 j = 1; j * j <= a[i]; ++j) {
                if (a[i] % j == 0) {
                    ++rec[j];
                    if (a[i] / j != j) ++rec[a[i] / j];
                    if((rec[a[i] / j] >= 2 || (j != 1 && rec[j] >= 2))){
                        flag = false;
                        break;
                    }
                }
            }
            if(!flag){
                as = false;
                break;
            }
        }
    }
    i32 k = a[0];
    rep(i,n){
        k = gcd(k,a[i]);
    }

    if(as && k == 1){
        cout << "pairwise coprime" << endl;
    }
    else if(!as && k == 1){
        cout << "setwise coprime" << endl;
    }else{
        cout << "not coprime" << endl;
    }
}
