#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int long long MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
int long long gcd(int long long a, int long long b) {
  if (a == 0 || b == 0) return max(a, b);
  if (b > a) swap(a, b);
  while (1) {
    if (a % b != 0) {
      int long long tmp = b;
      b = a % b;
      a = tmp;
    } else {
      return b;
    }
  }
}
int main() {
  int long long n;
  cin >> n;
  vector<int long long> v(n, 0);
  vector<int long long> g(n + 1, 0);
  bool f = false;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (i == 0) g[0] = v[i];
    g[i + 1] = gcd(g[i], v[i]);
  }
  if (g[n] == 1) f = true;
  vector<bool> fa(1000001, false);
  bool k = true;
  for (int i = 0; i < n; i++) {
    int long long a = v[i];
    for (int i = 2; i <= sqrt(a); i++) {
      if (a % i == 0) {
        if (!fa[i]) {
          fa[i] = true;
        } else {
          k = false;
          break;
        }
        while (a % i == 0) a /= i;
      }
    }
  }
  if (k) {
    cout << "pairwise coprime" << endl;
  } else if (f) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  return 0;
}
