#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int,int> pii;
typedef long long ll;
const long long MOD=1000000007;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep2(i,m,n) for(ll i=(m);i<(n);i++)
#define ALL(v) v.begin(), v.end()
#define pb push_back





int gcd(int a, int b){
     int bigger=max(a,b);
     int smaller=min(a,b);
     if (bigger%smaller==0){
         return smaller;
     }
     else {
         return gcd(smaller,bigger%smaller);

     }
     
}





int main(){

    int n;
    cin>>n;
    vi data(n);

    rep(i,n){
        int tmp;
        cin>>tmp;
        data.at(i)=tmp;
    }
  
  	sort(ALL(data));
  	


    vi checks(1000,1);
    checks.at(0)=0;
    checks.at(1)=0;

    for (int i=2;i<1000;i++){
        if (checks.at(i)==1){
            for (int j=2*i;j<1000;j+=i){
                checks.at(j)=0;
            }
        }

    }

    vi primes;

    for (int i=2;i<=999;i++){
        if (checks.at(i)==1 ){
            primes.pb(i);

        }
    }

    int mygcd=gcd(data.at(0),data.at(1));

    for (int i=2;i<=n-1){
        mygcd=gcd(mygcd,data.at(i));
    }

    




    int t=int(primes.size());
  

    vi result(t);

    rep(i,t){
        int tmp=0;
        rep(j,n){
            while (data.at(j)%primes.at(i)==0){
                data.at(j)/=primes.at(i);

            }
        }

        result.at(i)=tmp;
    }

    sort(ALL(data));

    bool flag=true;

    for (int i=0;i<n-2;i++){
        if (data.at(i)==data.at(i+1) and data.at(i)!=1){
            flag=false;
        }
    }










    if (flag){
        cout<<"pairwise coprime"<<endl;
     }

     else if (mygcd==1){
         cout<<"setwise coprime"<<endl;
     }

     else {
         cout<<"not coprime"<<endl;
              }
  
  








}
