#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool isPC = true;
set<ll> coprime;
map<ll, ll> primeFactorize(ll x) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= x; i++) {
    ll ex = 0;
    while (x % i == 0) {
      ex++;
      x /= i;
    }
    if (ex > 0) {
      res[i] = ex;
      if (coprime.count(i))
        isPC = false;
      else
        coprime.insert(i);
    }
  }
  if (x > 1) {
    res[x] = 1;
    if (coprime.count(x))
      isPC = false;
    else
      coprime.insert(x);
  }
  return res;
}
int main() {
  int N, i;
  cin >> N;
  vector<int> A(N);
  cin >> A[0];
  map<ll, ll> pF = primeFactorize(A[0]);
  for (i = 1; i < N; i++) {
    cin >> A[i];
    if (pF.size() == 0) continue;
    map<ll, ll> tpF = primeFactorize(A[i]);
    vector<ll> erases;
    for (const auto& [k, v] : pF) {
      if (tpF.count(k)) {
        erases.push_back(k);
      }
    }
    for (const ll k : erases) {
      pF.erase(k);
    }
  }
  if (isPC) {
    cout << "pairwise coprime" << endl;
  } else {
    if (pF.size() == 0) {
      cout << "setwise coprime" << endl;
    } else {
      cout << "not coprime" << endl;
    }
  }
  return 0;
}
