#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int gcd(ll a, ll b) {
  if (min(a, b) == 0) return max(a, b);
  return gcd(min(a, b), max(a, b) % min(a, b));
}
vector<bool> sosu(1010, 0);
bool gcdc(ll n) {
  queue<ll> q;
  for (int i = 2; i * i <= n; i++) {
    if (n % i) {
      continue;
    }
    bool check = 0;
    while (n % i == 0) {
      check = 1;
      n /= i;
    }
    q.push(i);
  }
  while (q.size() > 0) {
    if (sosu.at((q.front()))) {
      return 0;
    }
    sosu.at(q.front()) = 1;
    q.pop();
  }
  return 1;
}
using namespace std;
using ll = long long;
int main() {
  ll N = 0;
  cin >> N;
  int each = 0;
  int all = 1;
  vector<ll> A(N, 0);
  for (ll i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  for (int i = 0; i < N - 1; i++) {
    ll memo = gcd(A.at(i), A.at(i + 1));
    if (memo == 1) {
      each = 1;
      break;
    } else {
      A.at(i + 1) = memo;
    }
  }
  for (int i = 0; i < N; i++) {
    if (!gcdc(A.at(i))) {
      all = 0;
      break;
    }
  }
  if (all) {
    cout << "pairwise coprime" << endl;
  } else if (each) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  return 0;
}
