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

const int N = 1000010;
vector<vector<int>> shiev(N);

signed main() {
  int n;
  cin >> n;

  vector<int> a(n);
  rep(i,n) cin >> a[i];

  for (int i = 2; i <= N; i++) {
    for (int j = i; j <= N; j += i) {
      if(!shiev[j].empty()) break;
      shiev[j].push_back(i);
    }
  }

  bool flag = true;

  set<int> st;
  for (int i = 0; i < n; i++) {
    int x = a[i];
    for (auto it : shiev[x]) {
      int v = it;
      if(st.count(v)) flag = false;
      st.insert(v);
    }
    if(!flag) break;
  }

  int GCD = 0;
  for (int i = 1; i < n; i++) {
    GCD = gcd(GCD, gcd(a[i], a[i - 1]));
  }

  if(GCD == 1 && flag) {
    cout << "pairwise coprime" << endl;
  } else if(GCD == 1) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }

}
