#include <bits/stdc++.h>

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) {os << "(" << p.first << ", " << p.second << ")"; return os;}

vector<ll> getD(ll N) {
    vector<ll> ret;
    for(int i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            if (i != 1) ret.push_back(i);
            if (i != N / i) ret.push_back(N / i);
        }
    }
    return ret;
}

void solve() {
    int N;
    cin >> N;
    vector<ll> A(N);

    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    ll g = A[0];
    for (int i = 1; i < N; i++) {
        g = std::gcd(g, A[i]);
    }

    vector<int> flag(1000001, 0);
    bool ok = true;
    for (int i = 0; i < N; i++) {
        if (A[i] == 1) continue;
        
        vector<ll> D = getD(A[i]);
        for (int d = 0; d < D.size(); d++) {
            if (flag[D[d]]) {
                ok = false;
                break;
            }
            flag[D[d]] = 1;
        }
    }

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

int main() {
    #ifdef LOCAL_ENV
    cin.exceptions(ios::failbit);
    #endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    
    solve();
}