#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = long long(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1},
          Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
template <typename T>
vector<T> smallest_prime_factors(T n) {
  vector<T> spf(n + 1);
  for (int i = 0; i <= n; i++) spf[i] = i;
  for (T i = 2; i * i <= n; i++) {
    if (spf[i] == i) {
      for (T j = i * i; j <= n; j += i) {
        if (spf[j] == j) {
          spf[j] = i;
        }
      }
    }
  }
  return spf;
}
template <typename T>
vector<T> factolization(T x, vector<T> &spf) {
  vector<T> ret;
  while (x != 1) {
    ret.push_back(spf[x]);
    x /= spf[x];
  }
  sort(ret.begin(), ret.end());
  return ret;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  auto sp = smallest_prime_factors(long long(1000001));
  vector<bool> count(1000001, false);
  bool check = false;
  for (int i = 0; i < n; i++) {
    auto r = factolization(a[n - 1 - i], sp);
    r.erase(unique(r.begin(), r.end()), r.end());
    for (auto i : r) {
      if (count[i]) {
        cout << i << "\n";
        check = true;
      } else
        count[i] = true;
    }
  }
  if (check) {
    int g = a[0];
    for (int i = 1; i < n; i++) {
      g = gcd(g, a[i]);
    }
    if (g == 1) {
      cout << "setwise coprime"
           << "\n";
    } else {
      cout << "not coprime"
           << "\n";
    }
  } else {
    cout << "pairwise coprime"
         << "\n";
  }
}
