#include <bits/stdc++.h>
using namespace std;
vector<bool> isPrime;
vector<long long> primes;
void sieve(size_t max) {
  if (max + 1 > isPrime.size()) {
    isPrime.resize(max + 1, true);
  }
  isPrime[0] = false;
  isPrime[1] = false;
  for (size_t i = 2; i * i <= max; ++i)
    if (isPrime[i])
      for (size_t j = 2; i * j <= max; ++j) isPrime[i * j] = false;
  for (long long i = 0; i <= max; i++) {
    if (isPrime[i]) {
      primes.push_back(i);
    }
  }
}
int main() {
  long long N;
  cin >> N;
  long long A;
  long long appearedPrime[1000001];
  set<long long> checkPrime;
  long long notPair = 0;
  long long notSetwise = 0;
  sieve(1000001);
  for (long long i = 0; i < primes.size(); i++) {
    appearedPrime[primes[i]] = 0;
  }
  long long primesP = 0;
  for (long long i = 0; i < N; i++) {
    cin >> A;
    primesP = 0;
    if (i > 0) {
      for (auto itr = checkPrime.begin(); itr != checkPrime.end(); ++itr) {
        if (A % *itr != 0) {
          checkPrime.erase(*itr);
        }
      }
    }
    while (A > 1) {
      if (A % primes[primesP] == 0) {
        if (appearedPrime[primes[primesP]] == 1) {
          notPair = 1;
        }
        appearedPrime[primes[primesP]] = 1;
        if (i == 0) {
          checkPrime.insert(primes[primesP]);
        }
        while (A % primes[primesP] == 0) {
          A /= primes[primesP];
        }
      }
      primesP++;
    }
  }
  if (!checkPrime.empty()) {
    notSetwise = 1;
  }
  if (notPair == 0) {
    cout << "pairwise coprime" << endl;
  } else if (notSetwise == 0) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  return 0;
}
