#include <bits/stdc++.h>
using namespace std;
const long long INF = 4000000000000000001;
const int inf = 1001001001;
const int MOD = 1000000007;
long long mod_pow(long long N, long long M) {
  if (M == 0) return 1;
  long long res = mod_pow((N * N) % MOD, M / 2);
  if (M & 1) res = (res * N) % MOD;
  return res %= MOD;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int N;
  cin >> N;
  vector<long long> retu(N);
  for (int i = 0; i < N; i++) cin >> retu.at(i);
  long long GCD = 0;
  bool setwise_coprime = false;
  for (int i = 0; i < N; i++) {
    if (GCD == 0) {
      GCD = gcd(retu.at(i), retu.at(i + 1));
      i++;
    } else
      GCD = gcd(GCD, retu.at(i));
  }
  if (GCD == 1) {
    setwise_coprime = true;
  } else {
    cout << "not coprime"
         << "\n";
    ;
    return 0;
  }
  if (N > 78500) {
    cout << "setwise coprime"
         << "\n";
    ;
    return 0;
  }
  map<long long, int> prime_factor;
  for (int i = 0; i < N; i++) {
    vector<bool> primeFactor(1000005);
    long long now = retu.at(i);
    if (now == 1) {
      cout << "setwise coprime"
           << "\n";
      ;
      return 0;
    }
    while (true) {
      long long prv = now;
      for (long long j = 2; j <= sqrt(now); j++) {
        if (now % j == 0 && !primeFactor.at(j)) {
          primeFactor.at(j) = true;
          prime_factor[j]++;
          now /= j;
          break;
        }
      }
      if (prv == now) {
        if (!primeFactor.at(prv)) prime_factor[prv]++;
        break;
      }
    }
  }
  for (auto V : prime_factor) {
    if (V.second > 1) {
      cout << "setwise coprime"
           << "\n";
      ;
      return 0;
    }
  }
  cout << "pairwise coprime"
       << "\n";
  ;
}
