#include <bits/stdc++.h>
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
 
using namespace std;
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vi vec(n);
    set<int> factors;
    bool ok = true;
    bool is_prime;
    int f;
    forn(i,n) {
        cin >> vec[i];
        if (ok) {
            is_prime = true;
            if (vec[i] % 2 == 0) {
                if (factors.find(2) == factors.end()) {
                    is_prime = false;
                    factors.insert(2);
                }
                else {
                    ok = false;
                }
            }
            if (ok) {
                f = 3;
                while (f*f <= vec[i]) {
                    if (vec[i] % f == 0) {
                        is_prime = false;
                        if (factors.find(f) == factors.end()) {
                            factors.insert(f);
                        }
                        else {
                            ok = false;
                            break;
                        }
                    }
                    f += 2;
                }
                if (is_prime && factors.find(vec[i]) == factors.end()) {
                    factors.insert(vec[i]);
                }
                else if (is_prime && factors.find(vec[i]) != factors.end()) {
                    ok = false;
                }
            }
        }
    }
    if (ok) {
        cout << "pairwise coprime";
    }
    else {
        int val = vec[0];
        forn(i,n-1) {
            val = __gcd(val, vec[i+1]);
            if (val == 1) {
                break;
            }
        }
        if (val==1) {
            cout << "setwise coprime";
        }
        else {
            cout << "not coprime";
        }
        
    }
    
    return 0;
} 