#include <bits/stdc++.h>


using namespace std;


void sieve_of_eratosthenes(vector<bool> &is_prime) {
    long long N = is_prime.size() - 1;
    for (long long i = 2; i * i <= N; i++) {
        if (!is_prime[i])
            continue;
        for (long long j = i + i; j <= N; j += i) {
            is_prime[j] = false;
        }
    }
}


void list_prime_factors(vector<long long> &prime_factors, long long N) {
    // Sieve of eratosthenes but record the prime factor for each number.
    // eg, `prime_factors[4] == 2`, `prime_factors[9] == 3`
    prime_factors.resize(N + 1, 1);
    for (long long i = 2; i * i <= N; i++) {
        if (prime_factors[i] > 1)
            continue;
        for (long long j = i + i; j <= N; j += i) {
            if (prime_factors[j] == 1)
                prime_factors[j] = i;
        }
    }
}


void fast_prime_factorization(long long x, vector<pair<long long, long long>> &res, vector<long long> &prime_factors) {
    while (prime_factors[x] != 1) {
        long long pf = prime_factors[x];
        long long num = 1;
        x /= pf;
        while (pf == prime_factors[x]) {
            num++;
            x /= pf;
        }
        res.push_back(make_pair(pf, num));
    }
    if (res.size() > 0 && res.rbegin()->first == x) {
        res.rbegin()->second++;
    } else {
        res.push_back(make_pair(x, 1));
    }
}


using ll = long long;


ll recalc(vector<pair<ll, ll>> res) {
    ll ret = 1;
    for (auto p : res) {
        for (ll i = 0; i < p.second; i++) {
            ret *= p.first;
        }
    }
    return ret;
}


int main(void) {
    vector<long long> prime_factors;
    list_prime_factors(prime_factors, 1000000);
    ll N;
    cin >> N;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
    }

    vector<bool> used(1000000, false);
    bool flag = false;
    for (auto e : A) {
        vector<pair<ll, ll>> res;
        fast_prime_factorization(e, res, prime_factors);
        for (auto p : res) {
            ll prime = p.first;
            if (used[prime]) {
                flag = true;
                break;
            }
            used[prime] = true;
        }
        if (flag)
            break;
    }
    if (!flag) {
        cout << "pairwise coprime" << endl;
        return 0;
    }

    ll g = gcd(A[0], A[1]);
    for (ll i = 1; i < N; i++) {
        g = gcd(A[i], g);
    }
    if (g == 1) {
        cout << "setwise coprime" << endl;
    } else {
        cout << "not coprime" << endl;
    }
}
