#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return 0;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return 0;
}
ll calc_gcd(ll x, ll y) {
  if (!y) {
    return x;
  }
  return calc_gcd(y, x % y);
}
bool isPairwise(int N, const vector<ll>& A) {
  vector<bool> S(1000001, false);
  for (auto& a : A) {
    if (S[a]) {
      return false;
    }
    S[a] = true;
  }
  for (ll now = 2; now <= 1000000LL; ++now) {
    ll tmp = now;
    bool exists = false;
    while (tmp <= 1000000LL) {
      if (S[tmp]) {
        if (exists) {
          return false;
        } else {
          exists = true;
        }
      }
      tmp += now;
    }
  }
  return true;
}
bool isSetwise(int N, const vector<ll>& A) {
  ll gcd = A.front();
  for (auto& a : A) {
    gcd = calc_gcd(gcd, a);
  }
  return gcd == 1;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<ll> A(N);
  for (auto& a : A) {
    cin >> a;
  }
  if (isPairwise(N, A)) {
    cout << "pairwise coprime" << endl;
  } else if (isSetwise(N, A)) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  return 0;
}
