#include <bits/stdc++.h>
long long gys(long long, long long);
long long n, a[int(1e6) + 10], min;
int main() {
  min = 0x7fffffff;
  std::ios::sync_with_stdio(false);
  std::cin >> n;
  for (long long i = 1; i <= n; ++i)
    std::cin >> a[i], min = std::min(min, a[i]);
  bool sc = true, ssc, pc = true;
  for (long long i = 2; i <= n; ++i) {
    if (gys(a[1], a[i]) != 1) pc = false;
  }
  if (!pc) {
    for (long long i = 2; i <= sqrt(min) + 10 && sc; ++i) {
      if (min % i == 0) {
        ssc = false;
        for (long long j = 1; j <= n && !ssc; ++j) {
          if (a[j] % i != 0) ssc = true;
        }
        if (!ssc) sc = false;
      }
    }
  }
  if (pc) std::cout << "pairwise coprime" << std::endl;
  if (sc) std::cout << "setwise coprime" << std::endl;
  if (!pc && !sc) std::cout << "not coprime" << std::endl;
  return 0;
}
long long gys(long long x, long long y) { return (y == 0) ? x : gys(y, x % y); }
