#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int &x : v) cin >> x;
  const int mx = 1e6;
  vector<int> divisors(mx + 1);
  for (int i = 2; i <= 1000000; i++) {
    if (!divisors[i]) {
      for (int j = i; j <= 1000000; j += i) {
        divisors[j] = i;
      }
    }
  }
  unordered_map<int, unordered_set<int>> m;
  bool pair_wise_coprime = true;
  bool gcd_is_one = true;
  for (int x : v) {
    int cur = x;
    while (cur != 1) {
      auto &curr_map = m[divisors[cur]];
      curr_map.insert(x);
      if (curr_map.size() > 1) pair_wise_coprime = false;
      if (curr_map.size() == n) gcd_is_one = false;
      cur /= divisors[cur];
    }
  }
  if (pair_wise_coprime) {
    cout << "pairwise coprime\n";
    return 0;
  }
  if (gcd_is_one) {
    cout << "setwise coprime\n";
    return 0;
  }
  cout << "not coprime\n";
}
