#include<bits/stdc++.h>

template<size_t N>
struct Sieve_of_Eratosthenes{
  using i32 = int32_t;
  std::array<i32,N+1> factor;
  Sieve_of_Eratosthenes(){
    for(i32 p=2;p<=N;++p){
      if(factor[p])continue;
      factor[p] = p;
      for(i32 x=p+p;x<=N;x+=p){
        if(factor[x])continue;
        factor[x] = p;
      }
    }
  }
  std::vector<int> prime_factor(i32 x){
    std::vector<int> pf;
    while(1){
      pf.push_back(factor[x]);
      x = factor[x];
      if(x==factor[x])break;
    }
    return pf;
  }
};

signed main(){
  using namespace std;
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  cin>>n;
  vector<int> a(n);
  for(auto& ai:a)cin>>ai;

  constexpr int a_max = 1e6;
  Sieve_of_Eratosthenes<a_max> ushi;

  map<int,int> mp;
  bool pairwise_coprime = true;
  for(auto const& ai:a){
    for(auto const& p:ushi.prime_factor(ai)){
      if(mp.count(p)){
        pairwise_coprime = false;
        break;
      }
      mp[p]++;
    }
  }
  
  if(pairwise_coprime){
    cout<<"pairwise coprime"<<endl;
    return 0;
  }

  bool setwise_coprime = accumulate(begin(a),end(a),0,[](auto a,auto b){return gcd(a,b);}) == 1;
  if(setwise_coprime){
    cout<<"setwise coprime"<<endl;
    return 0;
  }

  cout<<"not coprime"<<endl;


}