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

#define pb push_back
#define all(a) begin(a), end(a)
#define deb(x) cout << #x << " = " << x << endl
#define debu(x, y) cout << "( " << #x << ", " << #y << " ) = ( " << x << ", " << y << " )" << endl

typedef long long ll;
ll mod=1000000007;

template <typename T> vector<T> readVector(int n) { vector<T> res(n); for (int i = 0 ; i < n ; i++) cin >> res[i]; return res; }

int N = 1e6 + 5;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; i++) {
        cin >> a[i];
    }
    bool one = true;
    bool two = false;

    int inter = a[0];
    for(int i=1; i<n; i++) {
        inter = __gcd(inter, a[i]);
        if(inter == 1) two = true;
    }

    /// here to compute one

    bool prime[N+1];
    vector<int> mark(N, 0);
    memset(prime, true, sizeof(prime));
    prime[1] = false;

    for (int p=2; p*p<=N; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=N; i += p)
                prime[i] = false;
        }
    }
    vector<int> check;
    for(int i=0; i<n; i++) {
        mark[a[i]]++;
        if(mark[a[i]] > 1) {
            one = false;
        }
        if(!prime[a[i]]) check.pb(a[i]);
    }

    for(int i=1; i<check.size(); i++) {
        if(__gcd(check[0], check[i]) != 1) {
            one = false;
            break;
        }
    }
  	reverse(all(check));
  	for(int i=1; i<check.size(); i++) {
        if(__gcd(check[0], check[i]) != 1) {
            one = false;
            break;
        }
    }

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

    return 0;
}
