#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define N               200005
#define ff              first
#define ss              second
#define ll              long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<ll,ll>
#define vi              vector<ll>
#define mii             map<ll,ll>
#define pq_max          priority_queue<ll>
#define pq_min          priority_queue<ll,vi,greater<ll> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            ll x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void fio(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

unordered_set<ll> primes;
bool p[1000005];

void sieve(){

    primes.insert(2), p[2] = true;
    for(ll x=3;x<=1000000;x+=2) p[x] = true;

    for(ll x=3;x<=1000000;x+=2){
        if(p[x]){
            primes.insert(x);
            for(ll y=x*x;y<=1000000;y+=x) p[y] = false;
        }
    }
}


int main(){
    fio();

    memset(p, false, sizeof p);
    sieve();

    ll n;
    cin>>n;
    ll a[n], g;
    ll cp = n;
    vi npr, pr;

    for(ll x=0;x<n;x++) {
        cin>>a[x];
        if(primes.find(a[x]) == primes.end()) {
            --cp;
            npr.pb(a[x]);
        }
        else pr.pb(a[x]);
    }

    if(cp == n) cout<<"pairwise coprime";
    else if(cp == n-1) {
        bool b = true;

        for(ll &j: pr){
            if(j % npr[0] == 0 or npr[0] % j == 0){
                b = false;
                break;
            }
        }

        if(b) cout<<"pairwise coprime";
        else{
            g = a[0];
            for(ll x=1;x<n;x++){
                g = __gcd(g, a[x]);
            }

            if(g == 1) cout<<"setwise coprime";
            else cout<<"not coprime";
        }
    }
    else{
        g = a[0];
        for(ll x=1;x<n;x++){
            g = __gcd(g, a[x]);
        }

        if(g == 1) cout<<"setwise coprime";
        else cout<<"not coprime";
    }

    return 0;
}