#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
using Ml = map<ll, ll>;
ll const INF = 1ll << 61;
double pi = 3.141592653589793238;
vector<ll> is_prime;
void Sieve(size_t max) {
  if (max + 1 > is_prime.size()) {
    is_prime.resize(max + 1, 0);
  }
  is_prime[0] = 0;
  is_prime[1] = 1;
  for (size_t i = 2; i * i <= max; ++i)
    if (!is_prime[i])
      for (size_t j = 1; i * j <= max; ++j) is_prime[i * j] = i;
}
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  Sieve(1e6);
  ll tmp;
  if (a[0] == a[1])
    tmp = a[0];
  else if (is_prime[a[0]] == 0 || is_prime[a[1]] == 0) {
    if (max(a[0], a[1]) % min(a[0], a[1]) == 0)
      tmp = min(a[0], a[1]);
    else
      tmp = 1;
  } else {
    if (a[0] % is_prime[a[1]] == 0) tmp = a[0] / is_prime[a[1]];
    if (a[1] % is_prime[a[0]] == 0) chmin(tmp, a[1] / is_prime[a[0]]);
    if (a[1] % is_prime[a[0]] != 0 && a[0] % is_prime[a[1]] != 0) tmp = 1;
  }
  bool flag = true;
  if (tmp != 1) flag = false;
  for (int i = 0; i < (n - 1); ++i) {
    if (a[i] == a[i + 1]) {
      if (max(tmp, a[i]) % min(tmp, a[i]) == 0)
        tmp = max(tmp, a[i]) / min(tmp, a[i]);
    } else if (is_prime[a[i]] == 0 || is_prime[a[i + 1]] == 0) {
      if (max(a[i], a[i + 1]) % min(a[i], a[i + 1]) == 0) {
        if (max(tmp, min(a[i], a[i + 1])) % min(tmp, min(a[i], a[i + 1])) == 0)
          tmp = max(tmp, min(a[i], a[i + 1])) / min(tmp, min(a[i], a[i + 1]));
      } else
        tmp = 1;
    } else {
      ll tmpp = INF;
      if (a[i] % is_prime[a[i + 1]] == 0)
        chmin(tmpp, a[i] / is_prime[a[i + 1]]);
      if (a[i + 1] % is_prime[a[i]] == 0)
        chmin(tmpp, a[i + 1] / is_prime[a[i]]);
      if (tmpp == INF) {
        tmp = 1;
      } else {
        if (max(tmp, tmpp) % min(tmp, tmpp) == 0)
          tmp = max(tmp, tmpp) / min(tmp, tmpp);
      }
    }
    if (tmp != 1) flag = false;
  }
  if (flag)
    cout << "pairwise coprime" << endl;
  else if (tmp == 1)
    cout << "setwise coprime" << endl;
  else
    cout << "not coprime" << endl;
  return 0;
}
