#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return GCD(b, a % b);
}
bool gcd(vector<long long> &v) {
  int ans = 0;
  for (auto &x : v) {
    ans = GCD(ans, x);
  }
  return (ans == 1);
}
vector<long long> primes(long long n) {
  vector<long long> ans;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      ans.push_back(i);
      while (n % i == 0) {
        n /= i;
      }
    }
  }
  if (n > 1) {
    ans.push_back(n);
  }
  return ans;
}
void solve() {
  unordered_set<long long> s;
  long long n, i;
  bool all;
  cin >> n;
  vector<long long> v(n);
  for (i = 0; i < n; i++) {
    cin >> v[i];
  }
  all = gcd(v);
  vector<long long> prime = primes(v[n - 1]);
  for (auto x : prime) {
    s.insert(x);
  }
  bool ispairwise = false;
  for (i = n - 2; i >= 0; i--) {
    prime = primes(v[i]);
    bool temp = true;
    for (auto x : prime) {
      if (s.count(x)) {
        temp = false;
      } else {
        s.insert(x);
      }
    }
    if (temp == true) {
      ispairwise = true;
      break;
    }
  }
  if (ispairwise) {
    cout << "pairwise coprime";
    return;
  }
  if (all) {
    cout << "setwise coprime";
    return;
  }
  cout << "not coprime";
}
int main() { solve(); }
