#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ull = uint64_t;
const ll INF = 9e18;

void print() { cout << endl; }
template <typename Head, typename... Tail>
void print(Head head, Tail... tail) {
    int size = sizeof...(Tail);
    cout << head;
    if (size > 0) {
        cout << " ";
    }
    print(tail...);
}

void print0() {}
template <typename Head, typename... Tail>
void print0(Head head, Tail... tail) {
    cout << head;
    print0(tail...);
}

vector<map<ll, ll>> prime_factors(ll n) {
    // エラトステネスの篩
    vector<ll> divprimes(n + 1, -1);
    vector<bool> isprime(n + 1, true);
    isprime[0] = false;
    isprime[1] = false;
    for (ll i = 2; i <= n; i++) {
        if (isprime[i]) {
            divprimes[i] = i;
            for (ll j = 2 * i; j <= n; j += i) {
                divprimes[j] = i;  // その数をふるい落とした素数を記録
                isprime[j] = false;
            }
        }
    }

    vector<map<ll, ll>> result(n + 1);
    for (ll i = 2; i <= n; i++) {
        ll p = divprimes[i];
        if (p != i) {
            for (auto pf : result[i / p]) {
                result[i].insert(pf);
            }
        }
        if (result[i].count(p)) {
            result[i][p]++;
        } else {
            result[i][p] = 1;
        }
    }
    return result;
}

vector<ll> makedivprimes(ll n) {
    vector<ll> divprimes(n + 1, -1);
    vector<bool> isprime(n + 1, true);
    isprime[0] = false;
    isprime[1] = false;
    for (ll i = 2; i <= n; i++) {
        if (isprime[i]) {
            divprimes[i] = i;
            for (ll j = 2 * i; j <= n; j += i) {
                divprimes[j] = i;  // その数をふるい落とした素数を記録
                isprime[j] = false;
            }
        }
    }
    return divprimes;
}

void prime_factor_fast(ll n, vector<ll> &divprimes, map<ll, ll> &result) {
    if (n <= 1) {
        return;
    }
    ll p = divprimes[n];
    if (!result.count(p)) {
        result[p] = 0;
    }
    result[p]++;
    prime_factor_fast(n / p, divprimes, result);
}

int main0() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
    }
    ll maxval = 1000000;
    auto pfs = prime_factors(maxval);

    // debug
    // auto pfss = prime_factors(100);
    // for (ll i = 2; i <= 100; i++) {
    //     print0(i, " ");
    //     for (auto p : pfss[i]) {
    //         print0(p.first, ":", p.second, " ");
    //     }
    //     print();
    // }

    vector<ll> usecount(maxval + 1, 0);
    for (ll i = 0; i < N; i++) {
        ll n = A[i];
        for (auto pf : pfs[n]) {
            usecount[pf.first]++;
        }
    }
    ll maxusecount = 0;
    for (auto u : usecount) {
        maxusecount = max(maxusecount, u);
    }
    if (maxusecount == N) {
        print("not coprime");
        return 0;
    } else if (maxusecount >= 2) {
        print("setwise coprime");
        return 0;
    } else {
        print("pairwise coprime");
        return 0;
    }
}

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
    }
    ll maxval = 1000000;
    auto divprimes = makedivprimes(maxval);
    vector<ll> usecount(maxval + 1, 0);
    for (ll i = 0; i < N; i++) {
        map<ll, ll> pfs;
        prime_factor_fast(A[i], divprimes, pfs);
        for (auto pf : pfs) {
            usecount[pf.first]++;
        }
    }
    ll maxusecount = 0;
    for (auto u : usecount) {
        maxusecount = max(maxusecount, u);
    }
    if (maxusecount == N) {
        print("not coprime");
        return 0;
    } else if (maxusecount >= 2) {
        print("setwise coprime");
        return 0;
    } else {
        print("pairwise coprime");
        return 0;
    }
}


Measured memory_bytes: 26788