#include <bits/stdc++.h>
using namespace std;
int64_t gcd(int64_t a, int64_t b) { return (a % b == 0 ? b : gcd(b, a % b)); }
int64_t lcm(int a, int b) { return (int64_t)a * b / gcd(a, b); }
int factorial(int a) {
  int b = 1;
  while (a) {
    b *= a--;
  }
  return b;
}
bool is_prime(int a) {
  if (a <= 1) return false;
  for (int i = 2; (int64_t)i * i <= a; i++) {
    if (a % i == 0) return false;
  }
  return true;
}
int get_adp(double x, int n) {
  return (int)round((x - (int)x) * pow(10, n)) % 10;
}
int64_t sigma(int64_t s, int64_t n) { return n * (2 * s + n - 1) / 2; }
int main() {
  int n, m = 0, max_a = 0;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    max_a = max(a[i], max_a);
  }
  vector<int> p;
  for (int i = 2; i <= max_a; i++) {
    if (is_prime(i)) {
      p.push_back(i);
      m++;
    }
  }
  if (m == 0) {
    cout << "pairwise coprime" << endl;
    return (0);
  }
  vector<int> flag(m, 0);
  int ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    int j = 0;
    while (a[i] != 1) {
      if (a[i] % p[j] == 0) {
        if (flag[j]) ans = 1;
        flag[j]++;
      }
      while (a[i] % p[j] == 0 && a[i] != 1) {
        a[i] /= p[j];
      }
      j++;
    }
  }
  if (ans == 1) {
    for (int i = 0; i < m; i++) {
      if (flag[i] == n) ans = 2;
    }
  }
  if (ans == 0)
    cout << "pairwise coprime" << endl;
  else if (ans == 1)
    cout << "setwise coprime" << endl;
  else
    cout << "not coprime" << endl;
}
