#include <bits/stdc++.h>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/algorithm/sort.hpp>

using namespace std;
using boost::sort;
using boost::adaptors::reversed;

struct sieve {
    vector<int> lp, pr;
    sieve(int n) : lp(n + 1, -1) {
        for (int i = 2; i <= n; i++) {
            if (lp[i] == -1) {
                lp[i] = i;
                pr.push_back(i);
            }
            for (int j = 0; j < (int)pr.size() && pr[j] <= lp[i] && i * pr[j] <= n; j++) {
                lp[i * pr[j]] = pr[j];
            }
        }
    }
};

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    int mxa = 0;
    int g = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        mxa = max(mxa, a[i]);
        if (i == 0) {
            g = a[i];
        } else {
            g = gcd(g, a[i]);
        }
    }
    sieve s(mxa);
    vector<int> v(mxa + 1, -1);
    bool pc = true;
    for (int i = 0; pc && i < n; i++) {
        int x = a[i];
        if (v[x] == -1) {
            v[x] = i;
        } else if (v[x] != i) {
            pc = false;
            break;
        }
        while (x != 1) {
            if (v[s.lp[x]] == -1) {
                v[s.lp[x]] = i;
            } else if (v[s.lp[x]] != i) {
                pc = false;
                break;
            }
            x /= s.lp[x];
        }
    }

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