#include <bits/stdc++.h>
using namespace std;
int _gcd(int x, int y) {
  if (y == 0) return x;
  return _gcd(y, x % y);
}
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int g = _gcd(0, a[0]);
  for (int i = 1; i < n; i++) g = _gcd(g, a[i]);
  map<int, set<int>> mp;
  int v = a[n - 1];
  for (int i = 2; i * i <= v; i++) {
    if (v % i == 0) {
      mp[i].insert(n - 1);
      while (v % i == 0) v = v / i;
    }
  }
  if (v >= 1) mp[v].insert(n - 1);
  int f = 0;
  for (int i = n - 2; i >= 0; i--) {
    set<int> chk;
    int v = a[i];
    for (int j = 2; j * j <= v; j++) {
      if (v % j == 0) {
        for (int tt : mp[j]) chk.insert(tt);
        mp[j].insert(i);
        while (v % j == 0) v = v / j;
      }
    }
    if (v >= 1) {
      for (int tt : mp[v]) chk.insert(tt);
      mp[v].insert(i);
    }
    if (chk.size() != n - i - 1) {
      f = 1;
      break;
    }
  }
  if (f == 1) {
    cout << "pairwise coprime" << endl;
  } else if (f == 0 && g == 1) {
    cout << "setwise coprime" << endl;
  } else
    cout << "not coprime" << endl;
  return 0;
}
