#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
const long long INF = 1LL << 60;
const long long mod = 1e9 + 7;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
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;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  vector<long long> left(n + 1, 0), right(n + 1, 0);
  long long g = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    g = gcd(g, a[i]);
    left[i + 1] = gcd(left[i], a[i]);
  }
  for (long long i = n - 1; i >= 0; i--) {
    right[n - i] = gcd(right[n - 1 - i], a[i]);
  }
  bool ok = 1;
  for (long long i = 0; i < n; i++) {
    if ((i != 0 and left[i + 1] != 1) or (right[n - i] != 1 and i != n - 1)) {
      ok = 0;
    }
  }
  if (ok) {
    cout << "pairwise coprime" << endl;
  } else if (g == 1) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
