#include <bits/stdc++.h>
using namespace std;
int64_t gcd(int64_t a, int64_t b) {
  if (a == 0) return b;
  if (b == 0)
    return a;
  else {
    if (a < b) swap(a, b);
    return gcd(b, a % b);
  }
}
void precalculatePrimes(vector<bool> &isPrime, vector<int64_t> &d) {
  int64_t aMax = isPrime.size() - 1;
  for (int64_t i = 2; i * i <= aMax; i++) {
    if (isPrime[i]) {
      for (int64_t j = i * i; j <= aMax; j += i) {
        isPrime[j] = false;
        if (d[j] == 0) d[j] = i;
      }
    }
  }
}
bool matchingPrimeFactors(vector<bool> isPrime, vector<int64_t> &d, int64_t x,
                          int64_t y) {
  map<int64_t, bool> seenPrimeFactor;
  while (x != 1) {
    if (d[x] == 0) d[x] = x;
    seenPrimeFactor[d[x]] = true;
    x /= d[x];
  }
  while (y != 1) {
    if (d[y] == 0) d[y] = y;
    if (seenPrimeFactor[d[y]]) return true;
    y /= d[y];
  }
  return false;
}
bool isVectorPairwiseCoprime(vector<bool> &isPrime, vector<int64_t> &d,
                             vector<int64_t> &ipVct) {
  for (int i = 0; i < ipVct.size(); i++) {
    for (int j = i + 1; j < ipVct.size(); j++) {
      if (matchingPrimeFactors(isPrime, d, ipVct[i], ipVct[j])) return false;
    }
  }
  return true;
}
bool isVectorSetwiseCoprime(vector<int64_t> &ipVct) {
  int64_t netGCD = gcd(ipVct[0], ipVct[1]);
  if (netGCD == 1) return true;
  for (int i = 2; i < ipVct.size(); i++) {
    netGCD = gcd(netGCD, ipVct[i]);
    if (netGCD == 1) return true;
  }
  return false;
}
int main() {
  vector<bool> isPrime(1000001, true);
  vector<int64_t> d(1000001);
  precalculatePrimes(isPrime, d);
  int64_t N, tmp;
  vector<int64_t> inVct;
  cin >> N;
  while (N--) {
    cin >> tmp;
    inVct.push_back(tmp);
  }
  if (isVectorPairwiseCoprime(isPrime, d, inVct))
    cout << "pairwise coprime\n";
  else if (isVectorSetwiseCoprime(inVct))
    cout << "setwise coprime\n";
  else
    cout << "not coprime\n";
  return 0;
}
