#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9 + 7;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
__attribute__((constructor)) void init() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(10);
}
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() {
  auto spf = smallest_prime_factors(1000010);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < (n); i++) {
    cin >> v[i];
  }
  map<int, int> mii;
  for (int i = 0; i < (n); i++) {
    set<int> si;
    for (auto u : factolization(v[i], spf)) {
      si.insert(u);
    }
    for (auto u : si) {
      mii[u]++;
    }
  }
  bool ok = 1;
  int cnt = 0;
  for (auto u : mii) {
    cout << u.first << " " << u.second << endl;
    if (!ok) break;
    if (u.second > 1) {
      ok = 0;
    }
    chmax(cnt, u.second);
  }
  if (ok) {
    cout << "pairwise coprime" << endl;
    return 0;
  }
  if (cnt == n) {
    cout << "not coprime" << endl;
    return 0;
  }
  cout << "setwise coprime" << endl;
  return 0;
}
