#include <bits/stdc++.h>
using namespace std;
const long long OO = (long long)(4e18) + 9;
const int MOD = (int)(1e9) + 7;
const int oo = 2147483647;
const double EPS = 1e-8;
const double PI = acos(-1.0);
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
string abc = "abcdefghijklmnopqrstuvwxyz";
string vowels = "aeiouy";
template <typename X, typename Y>
bool ckmin(X& a, Y b) {
  return a > b ? a = b, true : false;
}
template <typename X, typename Y>
bool ckmax(X& a, Y b) {
  return a < b ? a = b, true : false;
}
bool cklex(string& a, string b) {
  if (b == "") return false;
  if (a == "") return a = b, true;
  if ((int)a.size() < (int)b.size()) return false;
  if ((int)b.size() < (int)a.size()) return a = b, true;
  if (a < b) return false;
  return a = b, true;
}
int dcmp(long double d1, long double d2) {
  return fabs(d1 - d2) <= EPS ? 0 : d1 > d2 ? 1 : -1;
}
long long gcd(long long x, long long y) { return !y ? x : gcd(y, x % y); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int conv_2_1(int r, int c, int nCol) { return (nCol * r) + c + 1; }
pair<int, int> conv_1_2(int n, int nCol) { return {n / nCol, n % nCol}; }
template <typename T>
void inter(T X) {
  cout << X << endl;
  fflush(stdout);
}
long long _sieve_size = 1e6 + 10;
bitset<1000010> bs;
vector<long long> primes;
void sieve() {
  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(i);
    }
}
vector<long long> primeFactors(long long N) {
  vector<long long> factors;
  long long PF_idx = 0, PF = primes[PF_idx];
  while (PF * PF <= N) {
    while (N % PF == 0) {
      N /= PF;
      factors.push_back(PF);
    }
    PF = primes[++PF_idx];
  }
  if (N != 1) factors.push_back(N);
  return factors;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1, tt = 1;
  while (t--) {
    sieve();
    int n, gc = 0;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i], gc = gcd(gc, v[i]);
    map<int, int> mp;
    bool flag = true;
    for (int i = n - 1; i >= 0; i--) {
      if (bs[v[i]]) {
        if (mp[v[i]]) {
          flag = false;
          break;
        }
        mp[v[i]]++;
      } else {
        long long N = v[i], PF_idx = 0, PF = primes[PF_idx];
        while (PF * PF <= N) {
          if (N % PF == 0) {
            if (mp[PF]) {
              flag = false;
              break;
            }
            mp[PF]++;
          }
          while (N % PF == 0) N /= PF;
          PF = primes[++PF_idx];
        }
      }
      if (not flag) break;
    }
    if (flag)
      cout << "pairwise coprime\n";
    else if (gc == 1)
      cout << "setwise coprime\n";
    else
      cout << "not coprime\n";
  }
  return 0;
}
