#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 1e6 + 5;
int a[N], n, cnt[N];
map<int, int> mp;
vector<int> factorize(int val) {
  mp.clear();
  vector<int> ret;
  int va = val;
  for (int i = (int)(2); i < (int)(val); ++i) {
    if (i * i > val) break;
    int c = 0;
    while (va % i == 0) {
      va /= i;
      ++c;
    }
    if (c) {
      mp[i] = c;
      ret.push_back(i);
    }
  }
  if (va > 1) {
    mp[va] = 1;
    ret.push_back(va);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = (int)(0); i < (int)(n); ++i) {
    cin >> a[i];
  }
  int kk = 0;
  for (int i = (int)(n)-1; i >= (int)(0); --i) {
    auto v = factorize(a[i]);
    int p = 0;
    for (int x : v) {
      if (cnt[x] == 0) {
        ++p;
      }
      chkmax(cnt[x], mp[x]);
    }
    if (p == (int)(v.size()))
      ++kk;
    else
      break;
  }
  if (kk == n) {
    cout << "pairwise coprime\n";
  } else {
    for (int i = (int)(0); i < (int)(n); ++i) {
      auto v = factorize(a[i]);
      int p = 0;
      for (int x : v) {
        if (cnt[x] == 1) ++p;
      }
      if ((int)(v.size()) == p) {
        cout << "setwise coprime\n";
        return 0;
      }
    }
    cout << "not coprime\n";
  }
  return 0;
}
