#include <bits/stdc++.h>
using namespace std;
map<int64_t, int> prime_factor(int64_t n) {
  map<int64_t, int> ret;
  for (int64_t i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}
int main() {
  int N;
  vector<vector<int>> A;
  cin >> N;
  for (auto i = 0; i < N; i++) {
    int a;
    cin >> a;
    vector<int> primes;
    for (auto kv : prime_factor(a)) {
      primes.push_back(kv.first);
    }
    sort(primes.begin(), primes.end());
    A.push_back(primes);
  }
  vector<int> cup;
  vector<int> hat;
  bool initial = true;
  bool pc = true;
  for (auto primes : A) {
    vector<int> buf;
    set_intersection(cup.begin(), cup.end(), primes.begin(), primes.end(),
                     inserter(buf, buf.end()));
    if (pc && buf.size() > 0) pc = false;
    vector<int> buf2;
    set_union(cup.begin(), cup.end(), primes.begin(), primes.end(),
              inserter(buf2, buf2.end()));
    cup = buf2;
    if (initial) {
      hat = primes;
      initial = false;
    } else {
      vector<int> buf3;
      set_intersection(hat.begin(), hat.end(), primes.begin(), primes.end(),
                       inserter(buf3, buf3.end()));
      hat = buf3;
    }
  }
  bool sc = (hat.size() == 0);
  if (pc) {
    cout << "pairwise coprime" << endl;
  } else if (sc) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
}
