#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b != 0) return gcd(b, a % b);
  return a;
}
bool setw(int *a, int n) {
  int g = a[0];
  (i, a, b) for (int i = a; i < b; i++)(i, 1, n) { g = gcd(a[i], g); }
  if (g != 1) return false;
  return true;
}
bool pairw(int *a, int n) {
  (i, a, b) for (int i = a; i < b; i++)(i, 0, n) {
    (i, a, b) for (int i = a; i < b; i++)(j, i + 1, n) {
      if ((gcd(a[i], a[j]) != 1)) return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int a[n];
  (i, a, b) for (int i = a; i < b; i++)(i, 0, n) cin >> a[i];
  if (pairw(a, n))
    cout << "pairwise coprime"
         << "\n";
  else if (setw(a, n))
    cout << "setwise coprime"
         << "\n";
  else
    cout << "not coprime"
         << "\n";
  return 0;
}
