#include <bits/stdc++.h>
using namespace std;
long long _sieve_size;
bitset<1000001> bs;
bitset<1000001> used;
vector<int> primes;
void sieve(long long upperbound) {
  _sieve_size = upperbound + 1;
  bs.set();
  bs[0] = bs[1] = 0;
  for (long long i = 2; i <= _sieve_size; i++)
    if (bs[i]) {
      for (long long j = i * i; j <= _sieve_size; j += i) bs[j] = 0;
      primes.push_back((int)i);
    }
}
bool prime_factors(int n) {
  vector<int> pfs;
  int pf = 0;
  int pfactor = primes[pf];
  while (pfactor * pfactor <= n) {
    if (n % pfactor == 0) {
      pfs.push_back(pfactor);
      if (used[pfactor]) return true;
      used[pfactor] = 1;
    }
    while (n % pfactor == 0) {
      n /= pfactor;
    }
    pfactor = primes[++pf];
  }
  return false;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  sieve(1000001);
  int n;
  cin >> n;
  int a[n];
  bool isPairWise = true;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (prime_factors(a[i])) {
      isPairWise = false;
      break;
    }
  }
  int mcd = a[0];
  for (int i = 1; i < n; i++) {
    mcd = gcd(mcd, a[i]);
  }
  if (isPairWise) {
    cout << "pairwise coprime";
  } else if (mcd == 1) {
    cout << "setwise coprime";
  } else {
    cout << "not coprime";
  }
}
