#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

template<typename T>
istream& operator >> (istream& is, vector<T>& vs){
  for(T& v: vs) is >> v;
  return is;
}

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vs){
  for (const T& v : vs) os << v << " ";
  return os;
}

int main() {
  LL N; cin >> N;
  vector<LL> A(N); cin >> A;
  LL S = 0;
  for (LL x : A) S = gcd(S, x);
  bool setwise = (S == 1);

  vector<LL> P(N);
  P[N-1] = 1;
  for (int i = N - 2; i >= 0; --i) {
    P[i] = P[i + 1] * A[i + 1];
  }
  for (int i = N - 2; i >= 0; --i) {
    if (P[i] < P[i + 1]) assert(false);
  }

  bool pairwise = true;
  for (int i = 0; i < N-1; ++i) {
    LL x = gcd(A[i], P[i]);
    if (x != 1) {
      pairwise = false;
      break;
    }
  }

  if (pairwise) {
    cout << "pairwise coprime" << endl;
  } else if (setwise) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
}
