#include <bits/stdc++.h>
using namespace std;

struct Prime {
  long long n = 0;
  vector<bool> ch;
  vector<long long> ary;
  Prime(long long N = 2000000) {
    ch.resize(N + 1);
    ch[0] = ch[1] = 1;
    for (int i = 2; i <= N; ++i)
      if (!ch[i]) {
        ary.push_back(i);
        for (int j = 2; (long long)i * j <= N; ++j) ch[i * j] = 1;
      }
    n = ary.size();
  }
  inline const bool isprime(int n) { return !ch[n]; }
  inline const long long &operator[](int k) const {
    return k < n ? (ary[k]) : -1;
  }
};

int n;
vector<int> a;
set<int> st;
Prime pr;

int solve();

int main() {
  cin >> n;
  long long g = 0;
  for (int i = 0; i < n; ++i) {
    int p;
    cin >> p;
    g = gcd(p, g);
    if (pr.isprime(p)) {
      if (st.find(p) != st.end()) {
        cout << "not coprime" << endl;
        return 0;
      }
      st.insert(p);
    } else
      a.push_back(p);
  }
  int res = solve();
  if (res)
    cout << "pairwise coprime" << endl;
  else if (g == 1)
    cout << "setwise coprime" << endl;
  else
    cout << "not coprime" << endl;
  return 0;
}

int solve() {
  n = a.size();
  for (int i = 0; i < n; ++i) {
    long long p = a[i];
    for (long long j = 2; j * j <= p; ++j)
      if (p % j == 0) {
        if (st.count(j)) return 0;
        while (p % j == 0) p /= j;
        st.insert(j);
      }
    if (p > 1) {
      if (st.count(p)) return 0;
      st.insert(p);
    }
  }
  return 1;
}