#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;

ll gcd(ll a, ll b, ll mod) { return __gcd(a, b) % mod; }
ll lcm(ll a, ll b, ll mod) { return max(a, b) / gcd(a, b) * min(a, b) % mod; }
ll prd(ll a, ll b, ll mod) { return max(a, b) % mod * min(a, b) % mod; }
int solve(const vector<ll>& a, ll n, ll mod) {
    ll alcm = lcm(a[0], a[1], mod), prod = prd(a[0], a[1], mod);
    for (int i = 2; i < n; ++i)
        alcm = lcm(alcm, a[i], mod), prod = prd(prod, a[i], mod);
    if (alcm == prod) return 0;
    ll agcd = gcd(a[0], a[1], mod);
    for (int i = 2; i < n; ++i) agcd = gcd(agcd, a[i], mod);
    if (agcd == 1) return 1;
    return 2;
}

int main() {
    ll n;
    cin >> n;
    vector<ll> a(n);
    for (ll& i : a) cin >> i;
    int res   = 0;
    ll modl[] = {1000000007, 1000000009};
    for (ll p : modl) res = max(res, solve(a, n, p));
    switch (res) {
        case 0:
            cout << "pairwise coprime";
            return 0;
        case 1:
            cout << "setwise coprime";
            return 0;
        case 2:
            cout << "not coprime";
            return 0;
    }
}