#include <bits/stdc++.h>
using namespace std;

#define loop(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < n; ++i)
#define dump(a) cerr << #a << " = " << (a) << "(L:" << __LINE__ << ")" << endl

vector<int> primes;

void gen_primes() {
    const int N = 1000000;
    std::vector<bool> is_prime(N + 1, true);
    for (long long i = 2; i <= N; i++) {
        if (is_prime[i]) {
            for (long long j = 2 * i; j <= N; j += i) {
                is_prime[j] = false;
            }
            primes.emplace_back(i);
        }
    }
}

void solve(long long N, std::vector<long long> A) {
    gen_primes();
    vector<bool> used(primes.size());

    bool ok = true;
    auto B = A;
    rep(i, N) {
        if (B[i] == 1)
            if (!ok) break;
        rep(j, primes.size()) {
            if (B[i] % primes[j] == 0) {
                if (used[j]) {
                    ok = false;
                    break;
                }
                used[j] = true;
                B[i] %= primes[j];
            }
            if (B[i] < primes[j]) {
                break;
            }
        }
    }

    if (ok) {
        cout << "pairwise coprime" << endl;
        return;
    }

    auto g = A[0];
    rep(i, N) { g = __gcd(g, A[i]); }
    if (g == 1) {
        cout << "setwise coprime" << endl;
    } else {
        cout << "not coprime" << endl;
    }
}

int main() {
    long long N;
    scanf("%lld", &N);
    std::vector<long long> A(N);
    for (int i = 0; i < N; i++) {
        scanf("%lld", &A[i]);
    }
    solve(N, std::move(A));
    return 0;
}
