#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
const ll INF = 1e18;
const int mod = 1e9 + 7;
const int MAX = 1e6;
struct edge {
  int to, cost;
};
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool is_prime[MAX + 1];
int d[MAX + 1];
void erat() {
  for (int i = 0; i < MAX + 1; i++) d[i] = i;
  for (int i = 2; i <= MAX; i++) {
    if (d[i] == i) {
      for (int j = i + i; j <= MAX; j += i) {
        d[j] = i;
      }
    }
  }
}
void prime_fact(int x, set<int> &fact) {
  if (x < 2) return;
  while (x % d[x] == 0) {
    fact.insert(d[x]);
    x /= d[x];
  }
}
int n;
int a[MAX];
set<int> s;
bool flag = true;
int main() {
  erat();
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == 1) continue;
    if (flag) {
      set<int> fact;
      prime_fact(a[i], fact);
      for (int x : fact) {
        if (not s.count(x)) {
          s.insert(x);
        } else {
          flag = false;
          break;
        }
      }
    }
    if (i > 0) a[i] = gcd(a[i], a[i - 1]);
  }
  if (flag)
    cout << "pairwise coprime"
         << "\n";
  else if (a[n - 1] == 1)
    cout << "setwise coprime"
         << "\n";
  else
    cout << "not coprime"
         << "\n";
}
