#include <bits/stdc++.h>

using namespace std;

using ll = long long;

constexpr char newl = '\n';

template<typename T>
vector<T> sieve(T n) {
    vector<T> minf(n + 1, -1);
    minf[0] = 0;
    minf[1] = 1;
    for (T i = 2; i <= n; i++) {
        if (minf[i] != -1) continue;
        minf[i] = i;
        for (T j = 2 * i; j <= n; j += i) {
            if (minf[j] == -1) minf[j] = i;
        }
    }
    return minf;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    vector<int> minf = sieve(1000000);

    int n;
    cin >> n;

    bool is_pair = true;
    int all_g = 0;
    vector<int> used(1000001, n);
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;

        if (all_g == 0) all_g = a;
        else all_g = __gcd(all_g, a);

        if (!is_pair) continue;

        while (minf[a] != a) {
            if (used[minf[a]] < i) {
                is_pair = false;
                break;
            }

            used[minf[a]] = i;
            a /= minf[a];
        }
    }
    cout << (is_pair ? "pairwise coprime" : (all_g == 1 ? "setwise coprime" : "not coprime")) << newl;

    return 0;
}