#include <bits/stdc++.h>
using namespace std;

bool solve1(int N, vector<int> &A){
  sort(A.begin(),A.end());
  vector<bool> V(100001,false),W(100001,false);
  for(int i=0;i<N;i++){
    if(V[A[i]]) return false;
    V[A[i]] = true;
  }
  
  for(int i=2;i<=100000;i++){
    if(W[i]) continue;
    int count = 0;
    for(int j=2;j*i<=100000;j++){
      if(V[i*j]) count++;
      W[i] = true;
    }
    if(count>=2) return false;
  }
  return true;
}

bool solve2(int N, vector<int> &A){
  int g = A[0];
  for(int i=1;i<N;i++) g = gcd(g,A[i]);
  if(g==1) return true;
  else return false;
}

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i=0;i<N;i++) cin >> A[i];
  
  if(solve1(N,A)) cout << "pairwise coprime" << endl;
  else if(solve2(N,A)) cout << "setwise coprime" << endl;
  else cout << "not coprime" << endl;
  return 0;
}
