#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

vector<pair<ll, int>> factorize(ll n){
    vector<pair<ll, int>> res;
    for (ll i = 2; i*i <= n; ++i){
        if (n%i) continue;
        res.emplace_back(i, 0);
        while (n%i == 0){
            n /= i;
            res.back().second++;
        }
    }
    if(n != 1) res.emplace_back(n, 1);
    return res;
}

const int MAX = 1e6+5;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    int maxn = 0, minn = MAX;
    rep(i,n){
        cin >> a[i];
        maxn = max(maxn, a[i]);
        minn = min(minn, a[i]);
    }

    vector<int> d(maxn+1);
    for(int i = 1; i <= maxn; i++){
        for(int j = i; j <= maxn; j += i){
            d[j]++;
        }
    }

    vector<int> dd(maxn+1);
    for(int i = 0; i < n; i++){
        int x = a[i];
        if (x == 1 || dd[x] > 1) continue;
        if (d[x] == 2){
            for(int j = x; j <= maxn; j += x) dd[j]++;
        }else{
            vector<pair<ll, int>> res = factorize(x);
            for(int j = 0; j < res.size(); j++){
                int xx = res[j].first;
                if (dd[xx] > 1) continue;
                for(int k = xx; k <= maxn; k += xx){
                    dd[k]++;
                }
            }
        }
    }

    int cnt = 0;
    rep(i,n){
        cnt = max(cnt, dd[a[i]]);
    }
    if (cnt < 2){
        cout << "pairwise coprime" << endl;
        return 0;
    }

    if (minn == 1){
        cout << "setwise coprime" << endl;
        return 0;
    }

    int g = a[0];
    for(int i = 1; i < n; i++){
        g = __gcd(g, a[i]);
    }

    if (g == 1){
        cout << "setwise coprime" << endl;
        return 0;
    }

    cout << "not coprime" << endl;
    return 0;
}