#include <bits/stdc++.h>
//#define int long long

using namespace std;

constexpr int MAXN = 1e6 + 6, MOD = 1e9 + 7;

template<typename T>
inline void read(T& x, T f = 1, char ch = getchar()) {
    x = 0;
    while (!isdigit(ch)) f = (ch == '-') ? -1 : 1, ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
    x *= f;
}

int n, m, coprime;
array<int, MAXN> a, suf;
vector<int> divisor[MAXN];

map<int, int> cnt;

signed main() {
    std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    coprime = a[1];
    for (int i = 2; i <= n; i++) coprime = __gcd(coprime, a[i]);
    for (int i = 2; i <= 1e6; i++)
        for (int j = i; j <= 1e6; j += i)
            divisor[j].push_back(i);
    bool judge = true;
    for (int i = n; i >= 1; i--) {
        for (auto& c : divisor[a[i]]) {
            if (cnt[c]) {
                judge = false;
                break;
            }
        }
        if (judge == false) break;
        for (auto& c : divisor[a[i]]) {
            //cout << c << " ";
            cnt[c]++;
        }
        cout << endl;
    }
    if (judge) {
        cout << "pairwise coprime" << endl;
    } else if (coprime == 1) cout << "setwise coprime" << endl;
    else cout << "not coprime" << endl;
    return 0;
}