#include <bits/stdc++.h>

using namespace std;

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
void debug_out() {
    cerr << endl;
}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H), debug_out(T...);
}
const int INF = 1e9 + 5;
int main() {
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
    freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#else
#define debug(...) 3
    fastIO;
#endif
    int n;
    cin >> n;
    vector<int> v(n);
    map<int, bool> mp;
    map<int, bool> mp2;
    int g ;
    cin >> g;
    v[0] = g;
    mp[g] = 1;
    forn(i, n - 1)cin >> v[i + 1], mp[v[i + 1]] = 1, g = __gcd(g, v[i + 1]);
    sort(rall(v));
    vector<int> st;
    for(int i = 0; i < n ; i++) {
        st.pb(v[i]);
        mp2[v[i]] = 1;
        if(mp[v[i]]) {
            for(int j = 2; j * j < v[i] ; j++) {
                if(v[i] % j == 0) {
                    if(j * j == v[i])st.pb(j), mp2[j] = 1;
                    else st.pb(j), st.pb(v[i] / j), mp2[j] = 1, mp2[v[i] / j] = 1;
                }
            }
        }
        mp[v[i]] = 0;
    }
    bool ok = 1;
    sort(all(st));
    while(sz(st) > 1 && ok) {
        int x = st[sz(st)-1];
        st.pop_back();
        //debug(x, mp2[x]);
        if(mp2[x]) {
            for(int j = 2; j * j < x && ok; j++) {
                if(x % j == 0 && mp2[j]) ok = 0;
            }
        }
        mp2[x] = 0;
    }
    if(ok)cout << "pairwise coprime" << endl;
    else if(g == 1)cout << "setwise coprime" << endl;
    else cout << "not coprime" << endl;
    return 0;
}
