#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void solve() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    vector<ll> prev(1e6 + 5, -1);
    rep2(i, 2, 1e6) {
        if (prev[i] == -1) {
            for (int j = i; j <= 1e6; j += i) {
                prev[j] = i;
            }
        }
    }
    bool ok = true;
    set<ll> used;
    rrep(i, N - 1, 0) {
        ll a = A[i];
        if (a == 1) continue;
        vector<ll> x;
        while (prev[a] != a && a != 1) {
            x.push_back(prev[a]);
            ll v = prev[a];
            while (a % v == 0) {
                a /= v;
            }
        }
        x.push_back(a);
        for (ll v : x) {
            if (used.count(v)) {
                ok = false;
                break;
            }
        }
        for (ll v : x) {
            used.insert(v);
        }
    }
    if (ok) {
        cout << "pairwise coprime" << '\n';
    } else {
        ll g = 0;
        rep(i, N) {
            g = gcd(g, A[i]);
        }
        if (g == 1) {
            cout << "setwise coprime" << '\n';
        } else {
            cout << "not coprime" << '\n';
        }
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    return 0;
}
