#include<bits/stdc++.h>
using namespace std;
typedef  long long  ll;
ll inf=LLONG_MAX,mod=1000000007,BS,k;
ll prime[1000005];
ll seive(){
    for(ll i=0;i<1000005;i++)prime[i]=i;
    for(ll i=2;i<1000005;i++){
        if(prime[i]==i)
        for(ll j=i*i;j<1000005;j+=i)
        prime[j]=i;
    }
    return 0;
}
int main(){
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        #ifndef ONLINE_JUDGE
            freopen("input.txt","r",stdin);
            freopen("output.txt","w",stdout);
        #endif
        map<ll,ll> mp;
        seive();
        ll n;cin>>n;
        ll arr[n];
        for(ll i=0;i<n;i++)cin>>arr[i];
        ll flg=0,temp;vector<ll>ans;
        for(ll i=n-1;i>=0;i--){
            temp=arr[i];ans.clear();
            while(prime[temp]!=temp){
                if(mp[prime[temp]])
                flg=1;
                ans.push_back(prime[temp]);
                temp/=prime[temp];
            }
            if(temp!=1)
            mp[temp]++;
            for(auto it:ans)
            mp[it]++;
        }
        if(!flg)
        {
            cout<<"pairwise coprime";return 0;
        }
        ll g=0;
        for(ll i=0;i<n;i++){
            g=__gcd(g,arr[i]);
        }
        if(g==1){
            cout<<"setwise coprime";return 0;
        }
        cout<<"not coprime";

}
