#include <bits/stdc++.h>
using namespace std;
using namespace placeholders;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<vector<int> >;
using VS = vector<string>;
using ISS = istringstream;
using OSS = ostringstream;
using PII = pair<int, int>;
using VPII = vector<pair<int, int> >;
template <typename T = int>
using VT = vector<T>;
template <typename T = int>
using VVT = vector<vector<T> >;
template <typename T = int>
using LIM = numeric_limits<T>;
template <typename T = int>
using OSI = ostream_iterator<T>;
template <typename T>
inline istream &operator>>(istream &s, vector<T> &v) {
  for (T &t : v) {
    s >> t;
  }
  return s;
}
template <typename T>
inline ostream &operator<<(ostream &s, const vector<T> &v) {
  for (int i = 0; i < int(v.size()); ++i) {
    s << (" " + !i) << v[i];
  }
  return s;
}
void in_impl(){};
template <typename T, typename... TS>
void in_impl(T &head, TS &...tail) {
  cin >> head;
  in_impl(tail...);
}
template <typename T>
inline T fromString(const string &s) {
  T res;
  istringstream iss(s);
  iss >> res;
  return res;
}
template <typename T>
inline string toString(const T &a) {
  ostringstream oss;
  oss << a;
  return oss.str();
}
template <typename T>
inline bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
long long gcd(const long long a, const long long b) {
  return b == 0 ? a : gcd(b, a % b);
}
vector<long long> primeFactorization(long long N) {
  if (N == 1) {
    return vector<long long>();
  }
  std::vector<bool> is_prime(N + 1, true);
  std::vector<int> min_divisor(N + 1);
  std::iota(std::begin(min_divisor), std::end(min_divisor), 0);
  for (int i = 2; i <= N; ++i) {
    if (!is_prime[i]) {
      continue;
    }
    for (int j = 2; i * j <= N; ++j) {
      is_prime[i * j] = false;
      min_divisor[i * j] = i;
    }
  }
  std::vector<long long> result;
  while (1 < N) {
    result.push_back(min_divisor[N]);
    N /= min_divisor[N];
  }
  return std::move(result);
}
bool pairwise_coprime(const VI &A) {
  VVT<LL> pss;
  for_each(begin(A), end(A),
           [&](const int a) { pss.push_back(primeFactorization(a)); });
  set<LL> factors;
  for (auto &&ps : pss) {
    reverse(begin(ps), end(ps));
    ps.erase(unique(begin(ps), end(ps)), end(ps));
    for (auto &&p : ps) {
      if (((factors).find(p) != (factors).end())) {
        return false;
      }
      factors.emplace(p);
    }
  }
  return true;
}
bool setwise_coprime(const VI &A) {
  int g = A[0];
  for_each(begin(A), end(A), [&](const int a) { g = gcd(g, a); });
  return g == 1;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << setprecision(12) << fixed;
  int N;
  in_impl(N);
  ;
  VI A(N);
  cin >> A;
  if (pairwise_coprime(A)) {
    cout << "pairwise coprime" << endl;
  } else if (setwise_coprime(A)) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  return 0;
}
