#include<bits/stdc++.h>
using namespace std;
#define sz(x) (int)x.size()
#define pb push_back
#define mp make_pair
#define ll long long 
#define mod 1000000007
void fast(){
  ios_base::sync_with_stdio(false);cin.tie(NULL);
}

int main() {
   fast();
   int n;
   cin>>n;
   int a[n];

   for(int i=0;i<n;i++){
    cin>>a[i];
   }
   int allgcd=a[0];
   for(int i=1;i<n;i++){
    allgcd=__gcd(a[i],allgcd);
   }
   
   
     static const int N=1000005;
    static int smallestDivisor[N];
    static vector<int> primes;
 
    for(int i = 0; i <= N; i++)
        smallestDivisor[i] = i;
 
    for(int i = 2; i <= N; i++)
    {
        if(smallestDivisor[i] == i)
            primes.push_back(i);
        
        for(int j = 0; j < primes.size() && primes[j]*i <= N && primes[j] <= smallestDivisor[i]; j++)
            smallestDivisor[primes[j]*i] = primes[j];
    }
    int c[n];
    for(int i=0;i<n;i++){
      c[i]=smallestDivisor[a[i]];
    }
    sort(c,c+n);
    int g=0;
    for(int i=1;i<n;i++){
      if(c[i]!=c[i-1]){
        g=1;
        
      }else{
          g=0;
          break;
      }
    }
    if(g){
      cout<<"pairwise coprime"<<"\n";
      return 0;
    }


   if(allgcd==1){
       cout<<"setwise coprime"<<"\n";
       return 0;
   }
   cout<<"not coprime"<<"\n";
   return 0;



   
}
 