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

using ull = unsigned long long;
using ll = long long;
using ld = long double;

const int mod = 1e9 + 7;
const int inf = INT_MAX;
const int N = 1e6;

int n, a[N];
bool mark[N + 1];

bool prime[N + 1];
vector<int> primes;

void sieve() {
    memset(prime, true, sizeof(prime));
    prime[1] = false;

    for (int i = 2; i * i <= N; i++) {
        if (prime[i]) {
            for (int j = i * i; j <= N; j += i) {
                prime[j] = false;
            }
        }
    }
    for (int i = 2; i <= N; i++) {
        if (prime[i])
            primes.push_back(i);
    }
}

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

    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];

    int g = a[0];
    for (int i = 1; i < n; i++) g = __gcd(g, a[i]);

    for (int i = 0; i < n; i++) {
        if (mark[a[i]]) {
            if (g == 1)
                cout << "setwise coprime\n";
            else cout << "not coprime\n";
            return 0;
        }
        mark[a[i]] = true;
    }

    bool ok = true;
    sieve();

    for (int p : primes) {
        int c = 0;
        for (int j = p; j <= N; j += p) {
            c += mark[j];
        }
        ok &= c <= 1;
    }

    if (ok)
        cout << "pairwise coprime\n";
    else {
        if (g == 1)
            cout << "setwise coprime\n";
        else cout << "not coprime\n";
    }
    return 0;
}