#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int mxN = 1e6 + 5;
bool prime[mxN];
vector<ll> primenu;
void SieveOfEratosthenes() 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
     
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=mxN-1; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=mxN-1; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    // for (int p=2; p<=mxN-1; p++) 
    //    if (prime[p]) 
    //       primenu.pb(p); 
}
void solve(){
    SieveOfEratosthenes();
    map<ll,ll> primes;
    ll n;
    cin>>n;
    ll a[n];
    ll gcd = 0;
    bool doing = true;
    for(int i =0;i<n;i++){
        cin>>a[i];
        if(i==0){
            gcd = a[i];
        }
        else{
            gcd = __gcd(a[i],gcd);
        }
        if(doing){
            if(a[i]<4){
                if(prime[a[i]]){
                    primes[a[i]]++;
                    if(primes[a[i]]>1)
                        doing  = false;
                }
                continue;
            }
            for(ll j = 2;j*j<=a[i];j++){
                if(a[i]%j==0 && prime[j]){
                    primes[j]++;
                    // cout<<i<<" "<<j<<'\n';
                    if(primes[j]>1)
                        doing = false;
                }
            }
        }
    }
    bool ok = doing;
    // for(auto it : primes){
    //     cout<<it.F<<" "<<it.S<<'\n';
    // }
    if(gcd==1 && ok){
        cout<<"pairwise coprime\n";
    }
    else if(gcd==1){
        cout<<"setwise coprime\n";
    }
    else
    {
        cout<<"not coprime\n";
    }
    
}
int main(){
    IOS
    int tt;
    tt = 1;
    // cin>>tt;
    while(tt--){
        solve();
    }
    return 0;
}
