#include <bits/stdc++.h>

using namespace std;

#define PVAR(x) (cout << #x"=" << x << endl)

int main(void) {
  int n;
  cin >> n;
  vector<int> A(n);
  int ma = 0;
  for (int &a : A) {
    cin >> a;
    ma = max(ma, a);
  }

  vector<int> pfs(ma + 1);
  iota(pfs.begin(), pfs.end(), 0);
  for (int i = 2; i * i <= ma; i++) {
    if (pfs[i] == i) {
      for (int j = i * i; j <= ma; j += i) {
        pfs[j] = i;
      }
    }
  }

  int common_factor = A[0];
  bool pairwise_coprime = true;
  unordered_set<int> fs;
  for (int i = 0; i < n; i++) {
    int a = A[i];

    common_factor = gcd(common_factor, a);

    while (pairwise_coprime && a > 1) {
      if (fs.find(pfs[a]) == fs.end()) {
        fs.insert(pfs[a]);
        a /= pfs[a];
      } else {
        a = 1;
        pairwise_coprime = false;
      }
    }
  }


  if (pairwise_coprime) {
    cout << "pairwise coprime" << endl;
  } else if (common_factor == 1) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }

  return 0;
}

