#include <bits/stdc++.h>
std::vector<int> prime_factors(int n) {
  std::vector<int> a;
  for (int i = 2; i * i <= n; i++)
    for (; n % i == 0; n /= i) a.push_back(i);
  if (n != 1) a.push_back(n);
  a.erase(std::unique(std::begin(a), std::end(a)), std::end(a));
  return std::move(a);
}
int main(int argc, char** argv) {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);
  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);
  int N, A[1111111], C = 0;
  std::cin >> N;
  for (int i = 0; i < N; i++) std::cin >> A[i];
  bool is_setwise_coprime = true;
  for (int i = 0; i < N; i++) {
    std::vector<int> a = prime_factors(A[i]);
    for (const auto& p : a) {
      bool f = false;
      for (int j = i + 1; j < N; j++)
        if (A[j] % p == 0) {
          while (A[j] % p == 0) {
            A[j] /= p;
            C++;
          }
        } else {
          f = true;
        }
      if (i == 0)
        if (!f) is_setwise_coprime = false;
    }
  }
  if (C == 0) {
    std::cout << "pairwise coprime" << std::endl;
  } else if (is_setwise_coprime) {
    std::cout << "setwise coprime" << std::endl;
  } else {
    std::cout << "not coprime" << std::endl;
  }
  return 0;
}
