#include <bits/stdc++.h>
template <typename T>
std::map<T, int> prime_factorize(T n) {
  std::map<T, int> m;
  for (int i = 2; 1LL * i * i <= n; ++i) {
    int c = 0;
    for (; n % i == 0; n /= i) {
      ++c;
    }
    if (c != 0) {
      m[i] = c;
    }
  }
  if (n != 1) {
    m[n] = 1;
  }
  return m;
}
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
bool is_pairwise_coprime(int N, const vector<int>& A) {
  map<int, int> m;
  for (auto x : A) {
    for (auto& e : prime_factorize(x)) {
      m[e.first] += 1;
    }
  }
  for (auto& e : m) {
    if (e.second != 1) {
      return false;
    }
  }
  return true;
}
bool is_setwise_coprime(int N, const vector<int>& A) {
  return accumulate(A.begin(), A.end(), 0, gcd) == 1;
}
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (auto& x : A) {
    cin >> x;
  }
  if (is_pairwise_coprime(N, A)) {
    cout << "pairwise coprime" << endl;
  } else if (is_setwise_coprime(N, A)) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
}
