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

int main(){
  long n;  cin >> n;
  vector<long> a(n), seen(1e6+1, 0);
  for(int i=0; i<n; i++)  cin >> a[i];
  sort(a.begin(), a.end());

  vector<vector<int>> elems(n);
  string ans = "pairwise coprime";
  for(int i=0; i<n; i++){
    long ai = a[i];
    for(int j=2; j*j<=ai; j++)
      if(ai%j == 0){
        elems[i].push_back(j);
        while(ai%j == 0)  ai /= j;
      }
    if(ai != 1)  elems[i].push_back(ai);
  }
  
  vector<int> allelem;
  for(int i=0; i<elems[n-1].size(); i++)
    allelem.push_back(elems[n-1][i]);

  for(int i=n-2; i>=0; i--){
    bool flag = false;
    for(auto e : elems[i]){
      for(auto alle : allelem){
        if(e == alle){
          flag = true;
          break;
        }
      }
      if(flag)  break;
    }
    if(flag){
      ans = "setwise coprime";
      break;
    }
    for(auto e : elems[i])  allelem.push_back(e);
  }
  if(ans == "pairwise coprime"){
    cout << ans << endl;
    return 0;
  }
  bool yes = false;
  
  int tmp = a[0];
  for(int i=1; i<n; i++){
    int huku = 1;
    for(auto e : elems[i])  huku *= e;
    tmp = __gcd(tmp, huku);
    if(tmp == 1){
      yes = true;
      break;
    }
  }
  if(yes){
    cout << ans << endl;
    return 0;
  }
  cout << "not coprime" << endl;
  return 0;
}
