#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()

using ll = long long;
using ld = long double;
using namespace std;

const ll inf = 2e18;
const ll mod = 1e9 + 7;
const ll N = 1e6 + 5;

int n, primes[N], a[N];
map<int, set<int>> mp, mp2;

void pf(int n = 1e6 + 1) {
    memset(primes, 1, sizeof(primes));
    primes[1] = 0;

    for (int i = 2; i * i <= n; i++) {
        if (primes[i]) {
            for (int j = 2 * i; j <= n; j += i) {
                mp[j].insert(i);
                primes[j] = 0;
            }
        }
    }
}

void code() {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];

    pf();

    map<int, set<int>> ind;
    for (int i = 0; i < n; i++) {
        for (auto ele : mp[a[i]]) {
            ind[ele].insert(i);
        }
    }

    int f = 0;
    for (int i = 0; i < n; i++) {
        for (auto j : mp[a[i]]) {
            if (ind[j].upper_bound(i) != ind[j].end()) f = 1;
        }
    }

    if (!f) {
        cout << "pairwise coprime\n";
        return;
    }

    vector<int> suff(n + 1, 0); int gc = 0;
    for (int i = n - 1; i >= 0; i--) {
        suff[i] = __gcd(suff[i + 1], a[i]);
        gc = __gcd(gc, a[i]);
    }

    if (gc == 1) {
        cout << "setwise coprime\n";
        return;
    }

    cout << "not coprime\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int t = 1;
    // cin>>t;

    while (t-- > 0) {
        code();
    }
}