#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
T gcd(T a, T b) {
  T n = min(a, b);
  T m = max(a, b);
  if (n == 0) {
    return m;
  } else {
    return gcd(n, m % n);
  }
}
template <typename T>
T gcdAll(std::vector<T>& vals) {
  int size = vals.size();
  T gcdVal = vals[0];
  for (int i = 1; i < size; i++) {
    gcdVal = gcd(std::max(vals[i], gcdVal), std::min(vals[i], gcdVal));
  }
  return gcdVal;
}
int main(void) {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vector<int> visit(N, 1e9);
  queue<int> que;
  que.push(0);
  visit[0] = 0;
  while (!que.empty()) {
    int front = que.front();
    que.pop();
    for (int i = front + 1; i < N; i++) {
      if (visit[i] == 1e9) {
        if (gcd<int>(A[front], A[i]) == 1) {
          visit[i] = 0;
          que.push(i);
        }
      }
    }
  }
  bool isPairWise = true;
  for (int i = 0; i < N; i++) {
    if (visit[i] == 1e9) {
      isPairWise = false;
    }
  }
  if (isPairWise) {
    cout << "pairwise coprime" << endl;
    return 0;
  } else {
    int val = gcdAll(A);
    if (val == 1) {
      cout << "setwise coprime" << endl;
    } else {
      cout << "not coprime" << endl;
    }
    return 0;
  }
  return 0;
}
