#include <bits/stdc++.h>
#define repp(i,l,r)for(long long i=(l);i<(r);i++)
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define per(i,n) for (long long i = (n); i >= 0; --i)
#define all(v) v.begin(), v.end()
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

ll ngcd(vector<ll> a){
    ll res;
    res = a[0];
    for(ll i = 1; i < a.size() && res != 1; i++) {
        res = gcd(a[i], res);
    }
    return res;
}

vector<ll > prime_factorize(long long N) {
    vector<ll > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0;
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
        res.push_back(a);
    }
    if (N != 1) res.push_back(N);
    return res;
}

//ミョ(-ω- ?)
int main() {
    cin.tie(nullptr) ;
    ios::sync_with_stdio(false) ;

    ll n;
    cin >> n;
    vector<ll> a(n, 0);
    rep(i, n) cin >> a[i];
    bool b = true;

    // 累積 GCD (左と右両方)
    vector<int> left(n+1, 0), right(n+1, 0);
    for (int i = 0; i < n; ++i) left[i+1] = gcd(left[i], a[i]);
    for (int i = n-1; i >= 0; --i) right[i] = gcd(right[i+1], a[i]);

    for (ll i = 0; i < n - 1; i++) {
        if (gcd(left[i], right[i + 1]) != 1) b = false;
        if (!b) break;
    }
    if(b){
        cout << "pairwise coprime\n";
    }else if(left[n] == 1){
        cout << "setwise coprime\n";
    }else {
        cout << "not coprime\n";
    }
    return 0;
}