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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repr(i, n) for(int i = (n-1); i >= 0; --i)

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

typedef long long ll;
typedef pair<int, int> P;

const int MAX = 1000005;
const int INF = 1001001001;
const int MOD = 1000000007;

bool isPairwise(const vector<int> &v) {
    for (int i = 2; i < MAX; ++i) {
        bool flg = v[i];
        for (int j = i + i; j < MAX; j += i) {
            if (flg && v[j]) return false;
            flg ^= v[j]; 
        }
    }
    return true;
}

bool isSetwise(const vector<int> &v) {
    int gcd = v[0];
    for (auto &i : v) gcd = __gcd(gcd, i);
    return gcd == 1;
}

int main(){
    int N;
    cin >> N;

    vector<int> A(N);
    for (auto &i : A) cin >> i;

    vector<int> count(MAX);
    for (auto &i : A) count[i]++;

    if (isPairwise(count)) {
        cout << "pairwise coprime" << endl;
    } else if (isSetwise(A)) {
        cout << "setwise coprime" << endl;
    } else {
        cout << "not coprime" << endl;
    }
}