#include <bits/stdc++.h>
using namespace std;
void prime_factorize(long N, unordered_set<long> &set) {
  for (long a = 2; a * a <= N; ++a) {
    if (N % a != 0) {
      continue;
    }
    while (N % a == 0) {
      N /= a;
    }
    set.insert(a);
  }
  if (N != 1) {
    set.insert(N);
  }
}
int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; }
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<unordered_set<long>> ps;
  for (int i = 0; i < n; ++i) {
    unordered_set<long> s;
    prime_factorize(a[i], s);
    ps.push_back(s);
  }
  vector<unordered_set<long>> ps_merge = ps;
  ps_merge[n - 1] = ps[n - 1];
  for (int i = n - 2; i >= 0; --i) {
    unordered_set<long> s = ps_merge[i + 1];
    ps_merge[i].insert(s.begin(), s.end());
  }
  bool p_coprime = true;
  for (int i = 0; i < n - 1; ++i) {
    for (auto item : ps[i]) {
      if (ps_merge[i + 1].find(item) != ps_merge[i + 1].end()) {
        p_coprime = false;
        break;
      }
    }
  }
  if (p_coprime) {
    cout << "pairwise coprime" << endl;
  } else {
    int x1 = a[0];
    for (int i = 1; i < n; ++i) {
      int x2 = a[i];
      x1 = gcd(x1, x2);
    }
    if (x1 == 1) {
      cout << "setwise coprime" << endl;
    } else {
      cout << "not coprime" << endl;
    }
  }
}
