#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using ii = pair<int, int>;
using vvi = vector<vi>;
using vii = vector<ii>;
using gt = greater<int>;
using minq = priority_queue<int, vector<int>, gt>;
using P = pair<ll, ll>;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n = 1) : n(n), f(n + 1) {
    f[0] = f[1] = -1;
    for (ll i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.push_back(i);
      f[i] = i;
      for (ll j = i * i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x; }
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      if (res.size() == 0 || res.back() != f[x]) res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<pair<ll, int>> factor(ll x) {
    vector<pair<ll, int>> res;
    for (int p : primes) {
      int y = 0;
      while (x % p == 0) x /= p, ++y;
      if (y != 0) res.emplace_back(p, y);
    }
    if (x != 1) res.emplace_back(x, 1);
    return res;
  }
};
int n;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() {
  cin >> n;
  vi A(n);
  for (int i = 0; i < (n); ++i) cin >> A[i];
  Sieve sieve(1e6 + 1);
  bool pairwise = true;
  vector<bool> fac(1e6 + 10);
  [&] {
    for (int i = 0; i < (n); ++i) {
      vi list = sieve.factorList(A[i]);
      for (ll num : list) {
        if (fac[num]) {
          pairwise = false;
          return;
        }
        fac[num] = true;
        cout << num << " ";
      }
      cout << endl;
    }
  }();
  if (pairwise) {
    puts("pairwise coprime");
    return 0;
  }
  ll now = A[0];
  for (ll i = 1; i <= n; ++i) {
    now = gcd(now, A[i]);
  }
  if (now == 1) {
    puts("setwise coprime");
    return 0;
  }
  puts("not coprime");
  return 0;
}
