#include <bits/stdc++.h>
#define int long long
using namespace std;

vector<int> vis;
int cnt = 0;

void dfs(int i, vector<vector<int>>& adj) {
    if (vis[i]) return;
    vis[i] = 1;
    cnt++;
    for (int v : adj[i]) {
        dfs(v, adj);
    }
}

int32_t main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    // cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        const int mxn = 1e6;
        vector<int> cnt(mxn);
        int g = 0, p = 1;
        for (int j = 0; j < n; j++) {
            g = __gcd(g, a[j]);
            int x = a[j];
            bool ok = 1;
            for (int f = 2; f * f <= x && ok; f++) {
                if (x % f == 0) {
                    cnt[f]++;
                    if (cnt[f] > 1) {
                        // cout << f << endl;
                        ok = false;
                        break;
                    }
                    while (x % f == 0) x /= f;
                }
            }
            if (x > 1) {
                cnt[x]++;
                if (cnt[x] > 1) ok = false;
            }
            if (!ok) {
                p = 0;
                break;
            }
        }
        if (p) cout << "pairwise coprime";
        else if (g == 1) cout << "setwise coprime";
        else cout << "not coprime";
    }
    return 0;
}
