#include <bits/stdc++.h>
using namespace std;
int getgcd(int m, int n) {
  if (n == 0) return m;
  return getgcd(n, m % n);
}
bool isPairwiseCoprime(set<int> &s) {
  vector<int> ischecked(1000010 + 1, false);
  for (int i = 2; i <= 1000010; i++) {
    if (ischecked[i]) continue;
    int cnt = 0;
    for (int j = i; j <= 1000010; j += i) {
      ischecked[j] = true;
      if (s.find(j) != s.end()) cnt++;
    }
    if (cnt > 1) {
      return false;
    }
  }
  return true;
}
bool isSetwiseCoprime(set<int> s) {
  int gcd = *(s.begin());
  for (auto itr = s.begin(); itr != s.end(); itr++) {
    gcd = getgcd(gcd, *itr);
  }
  return gcd == 1;
}
int main() {
  int n;
  cin >> n;
  set<int> s;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    s.insert(a);
  }
  if (isPairwiseCoprime(s)) {
    cout << "pairwise coprime" << endl;
  } else if (isSetwiseCoprime(s)) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
}
