#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6;
int v[MAX], divisors[MAX + 1], x, cur, i, j, n;
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &v[i]);
  for (i = 2; (i * i) <= MAX; i++) {
    if (!divisors[i]) {
      for (j = i; j <= MAX; j += i) {
        divisors[j] = i;
      }
    }
  }
  unordered_map<int, unordered_multiset<int>> m;
  bool pair_wise_coprime = true;
  bool gcd_is_one = true;
  unordered_set<int> q;
  for (i = 0; i < n; i++) {
    x = v[i];
    cur = x;
    q.clear();
    while (cur != 1) {
      q.insert(divisors[cur]);
      cur /= divisors[cur];
    }
    for (int div : q) {
      auto &curr_map = m[div];
      curr_map.insert(x);
      if (curr_map.size() > 1) pair_wise_coprime = false;
      if (curr_map.size() == n) gcd_is_one = false;
    }
  }
  if (pair_wise_coprime) {
    puts("pairwise coprime");
    return 0;
  }
  if (gcd_is_one) {
    puts("setwise coprime");
    return 0;
  }
  puts("not coprime");
}
