#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > v[1000005];
vector<long long> prime;
long long a[1000005], n;
long long gcd(long long p, long long q) { return q ? gcd(q, p % q) : p; }
long long lcm(long long p, long long q) { return p * q / gcd(p, q); }
bool pairwise(void) {
  vector<pair<long long, long long> > LCM = v[1], mul = v[1];
  long long i, j;
  for (i = 2; i <= n; i++) {
    map<long long, long long> M, K;
    vector<pair<long long, long long> > next, kk;
    for (j = 0; j < (long long)LCM.size(); j++)
      M[LCM[j].first] = K[LCM[j].first] = LCM[j].second;
    for (j = 0; j < (long long)v[i].size(); j++) {
      M[v[i][j].first] = max(M[v[i][j].first], v[i][j].second);
      K[v[i][j].first] += v[i][j].second;
    }
    for (pair<long long, long long> pr : M)
      if (pr.second != 0) next.push_back(make_pair(pr.first, pr.second));
    for (pair<long long, long long> pr : K)
      if (pr.second != 0) kk.push_back(make_pair(pr.first, pr.second));
    LCM = kk;
  }
  return LCM == mul;
}
bool setwise(void) {
  vector<pair<long long, long long> > GCD = v[1];
  long long i, j;
  for (i = 2; i <= n; i++) {
    map<long long, long long> M;
    vector<pair<long long, long long> > next;
    for (j = 0; j < (long long)GCD.size(); j++) M[GCD[j].first] = GCD[j].second;
    for (j = 0; j < (long long)v[i].size(); j++)
      M[v[i][j].first] = min(M[v[i][j].first], v[i][j].second);
    for (pair<long long, long long> pr : M)
      if (pr.second != 0) next.push_back(make_pair(pr.first, pr.second));
    GCD = next;
  }
  return GCD.empty();
}
bool is_prime(int x) {
  int i;
  for (i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
int main(void) {
  long long i;
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (i = 2; i <= 1000; i++)
    if (is_prime(i)) prime.push_back(i);
  for (i = 1; i <= n; i++) {
    int tmp = a[i];
    int cnt = 0;
    if (tmp == 1) continue;
    while (tmp != 1) {
      int num = 0;
      while (tmp % prime[cnt] == 0) tmp /= prime[cnt], num++;
      v[i].push_back(make_pair(prime[cnt], num));
      cnt++;
    }
    if (tmp == a[i]) v[i].push_back(make_pair(tmp, 1));
  }
  if (pairwise())
    puts("pairwise coprime");
  else if (setwise())
    puts("setwise coprime");
  else
    puts("not coprime");
  return 0;
}
