#include<bits/stdc++.h>

#define ntest 0

using namespace std;

int n;
int a[1010000];
int allGcd, cntCoprime;
set<int> factors;
int minprime[1010000];
void prepare() {
    for (int i = 2; i * i <= 1000000; ++i) {
        for (int j = i * i; j <= 1000000; j+=i) minprime[j] = i;
    }
    for (int i = 1; i <= 1000000; ++i) if (!minprime[i]) minprime[i] = i;
}
int coprime(int x) {
    if (x == 1) return !!factors.insert(x).second;
    set<int> fac;
    while(x != 1) {
        fac.insert(minprime[x]);
        x /= minprime[x];
    }
    for (auto &i : fac) if (!factors.insert(i).second) return 0;
    return 1;
}
void solve() {
    prepare();
    cin >> n;
    allGcd = 0;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        allGcd = __gcd(allGcd, a[i]);
    }
    for (int i = n; i >= 1; --i) {
        if (coprime(a[i])) ++cntCoprime;
    }
    //cout << "cnt: " << cntCoprime << '\n';
    if (cntCoprime == n) cout << "pairwise coprime\n";
    else if (allGcd == 1) cout << "setwise coprime\n";
    else cout << "not coprime\n";
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    if(ntest){
        int t;
        cin >> t;
        while(t--) solve();
    } else {
        solve();
    }

}


