#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  unordered_map<long long, set<long long>> m;
  long long n;
  cin >> n;
  vector<long long> odd, even;
  vector<long long> v(n);
  bool ok = false, ok1 = false;
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    long long have = v[i];
    for (long long j = 2; j * j <= have; j++) {
      if (have % j == 0) {
        while (have % j == 0) {
          m[j].insert(i);
          have = have / j;
        }
      }
    }
    if (have > 1) {
      m[have].insert(i);
    }
  }
  for (auto k : m) {
    if (k.second.size() >= 2) {
      ok = true;
    }
    if (k.second.size() >= n) {
      ok1 = true;
    }
    if (ok && ok1) break;
  }
  if (!ok && !ok1)
    cout << "pairwise coprime" << '\n';
  else {
    if (ok && !ok1)
      cout << "setwise coprime" << '\n';
    else
      cout << "not coprime" << '\n';
  }
}
