#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

std::vector<int> Eratosthenes( const int N )
{
    std::vector<bool> is_prime( N + 1 );
    for( int i = 0; i <= N; i++ )
    {
        is_prime[ i ] = true;
    }
    std::vector<int> P;
    for( int i = 2; i <= N; i++ )
    {
        if( is_prime[ i ] )
        {
            for( int j = 2 * i; j <= N; j += i )
            {
                is_prime[ j ] = false;
            }
            P.emplace_back( i );
        }
    }
    return P;
}

int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  rep(i,n)cin>>a[i];
  bool ok1=true,ok2=true;
  //2
  int g=__gcd(a[0],a[1]);
  rep(i,n)g=__gcd(g,a[i]);
  if(g!=1)ok2=false;
  //1
  set<int>se;
  vector<int>e=Eratosthenes(1000005);
  rep(i,n){
    set<int>cnt;
    rep(j,e.size()){
      while(a[i]%e[j]==0){
        a[i]/=e[j];
        cnt.insert(e[j]);
      }
    }
    if(a[i]!=1)cnt.insert(a[i]);
    for(auto&p:cnt){
      if(se.find(p)!=se.end())ok1=false;
      se.insert(p);
    }
  }
  if(ok1){cout<<"pairwise coprime"<<endl; return 0;}
  if(ok2){cout<<"setwise coprime"<<endl; return 0;}
  cout<<"not coprime"<<endl;
}