#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
class SieveOfEratosthenes {
 private:
  std::vector<int> v;

 public:
  SieveOfEratosthenes(const int max) {
    v.resize(max + 1);
    init();
  }
  void init(void) {
    const auto n = v.size();
    for (int i = 0; i < n; i++) {
      v[i] = i;
    }
    for (int i = 2; i < n; i++) {
      if (v[i] != i) {
        continue;
      }
      for (int j = i * 2; j < n; j += i) {
        v[j] = std::min(v[j], i);
      }
    }
  }
  int get(int a) { return v[a]; }
};
template <typename T>
T gcd(T a, T b) {
  if (a < b) {
    std::swap(a, b);
  }
  return b ? gcd(b, a % b) : a;
}
bool isPairwiseCoprime(const std::vector<int> &a, int max) {
  SieveOfEratosthenes sieve(max);
  const auto n = a.size();
  std::vector<int> count(max + 1, 0);
  for (int i = 0; i < n; i++) {
    int val = a[i];
    while (1) {
      int pf = sieve.get(val);
      while (val % pf == 0) {
        val /= pf;
      }
      count[pf]++;
      if (count[pf] > 1) {
        return false;
      }
      if (val == 1) {
        break;
      }
    }
  }
  return true;
}
bool isSetwiseCoprime(const std::vector<int> &a) {
  const auto n = a.size();
  int all = a[0];
  for (int i = 1; i < n; i++) {
    all = gcd<int>(all, a[i]);
  }
  return all == 1;
}
int main(int argc, char *argv[]) {
  const int MAX = 1000000;
  int n;
  std::vector<int> a;
  std::cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) {
    std::cin >> a[i];
  }
  if (isPairwiseCoprime(a, MAX)) {
    std::cout << "pairwise coprime" << std::endl;
  } else {
    if (isSetwiseCoprime(a)) {
      std::cout << "setwise coprime" << std::endl;
    } else {
      std::cout << "not coprime" << std::endl;
    }
  }
  return 0;
}
