#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using vll = vector<ll> ;
#define all(v) v.begin(),v.end()
vll table(1e6+10,0);
  
void add_div(int a){
  for (int i = 1; i * i <= a; i++) {
    if (a % i == 0) {
      table[i]++;
      if (i * i != a) table[a/i]++;
    }
  }
}

vector<long long> divisor(long long n) {
  vector<long long> ret;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}

int main(){
  ll N;cin>>N;
  vll A(N);rep(i,N)cin>>A[i];
  vector<bool> vf(N);
  ll allgcd=A[N-1];
  rep(i,N) allgcd=__gcd(A[i],allgcd);
  bool flag = true;
  bool flag2 = (allgcd == 1);
  for(int i=N-2;i>=0;--i){
    vll v = divisor(A[i]);
    rep(i,v.size()){
      if(v[i]==1)continue;
      if(table[v[i]]!=0) flag=false;
    }
    add_div(A[i]);
  }
  if(flag && flag2) cout<<"pairwise coprime"<<endl;
  else if(!flag && flag2) cout<<"setwise coprime"<<endl;
  else cout <<"not coprime"<< endl;
}