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

#define pb push_back
#define ll long long

ll M= 1000000007;
ll pf[1000005];

int main() {

    ll n;
    cin>>n;
    vector<ll> v(n);
    memset(pf,0,sizeof(pf));
    for(ll i=0;i<n;i++) {
        cin>>v[i];
    }
    ll g=v[0];
    bool flag1=true;
    
    for(ll i=0;i<n;i++) {
        g = __gcd(g,v[i]);
        if(v[i]!=1) {
            pf[v[i]]++;
        }
        for(ll j=2;j*j<=v[i];j++) {
            if(v[i]%j==0) {
                pf[j]++;
                if(pf[j]>1) {
                    flag1=false;
                    break;
                }
                while(v[i]%j==0) {
                    v[i]=v[i]/j;
                }
            }
        }
    }

    if(flag1) {
        cout<<"pairwise coprime"<<endl;
    } else if(g==1) {
        cout<<"setwise coprime"<<endl;
    } else {
        cout<<"not coprime"<<endl;
    }

    return 0;

}