#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    bool pairwise = true, setwise = true;

    map<int,int> m;

    int g = -1;

    for (int i = 0; i < n; i++) {
        int val;
        cin >> val;
        if (g == -1)    g = val;
        else g = __gcd(g, val);
        m[val]++;
        if (m[val] >= 2 && val != 1)    pairwise = false;
    }

    if (g != 1) setwise = false;
    vector<bool> isPrime(1000001, true);
    isPrime[0] = isPrime[1] = false;

    for (int i = 2; i *i <= 1000000; i++) {
        int val = 0;
        if (m.count(i)) val++;
        if (!isPrime[i])    continue;
        for (int j = i*i; j <= 1000000; j+= i) {
            if (j % i == 0) {
                if (m.count(j)) val++;
                isPrime[j] = false;
            }
        }
        if (val >= 2) {
            pairwise = false;
            break;
        }
    }

    if (pairwise) {
        cout << "pairwise coprime\n";
    } else if (setwise) {
        cout << "setwise coprime\n";
    } else {
        cout << "not coprime\n";
    }

    return 0;
}