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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define endl '\n'

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;

const ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// head

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;
    set<int> s;
    int g;
    bool hasOne = false;
    for (int i = 0; i < n; i++) {
        int u;
        cin >> u;
        if(s.count(u)) hasOne = true;
        s.insert(u);
        if(i == 0) g = u;
        else g = __gcd(u, g);
    }
    if(s.count(1) && sz(s) == 1) {
        cout << "pairwise coprime" << endl;
        return 0;
    }
    bool pairWise = true;
    if(!hasOne) {
        const int nax = 1e6 + 2;
        vector<bool> p(nax, true);
        for(int i = 2; i < nax; i++) {
            int cnt = 0;
            if(p[i]) {
                cnt += s.count(i);
                for(int j = 2 * i; j < nax; j += i) {
                    p[j] = false;
                    if(s.count(j)) cnt++;
                }
            }
            if(cnt > 1) {
                pairWise = false;
            }
        }
    } else {
        pairWise = false;
    }

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

    return 0;
}
