#include <bits/stdc++.h>
using namespace std;
using pii = pair<long long, long long>;
long long A[1001000];
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> A[i];
  long long g = gcd(A[n - 1], A[n]);
  bool sc = g == 1 ? true : false;
  for (long long i = n - 2; !sc && i >= 1; i--) {
    g = gcd(g, A[i]);
    if (g == 1) sc = true;
  }
  if (!sc) {
    cout << "not coprime";
    return 0;
  }
  g = gcd(A[n - 1], A[n]);
  if (g > 1) {
    cout << "setwise coprime";
    return 0;
  }
  set<long long> pr;
  for (long long i = 2; i <= sqrt(g); i++) {
    if (g % i == 0) pr.insert(i);
    while (g % i == 0) g /= i;
  }
  if (g > 1) pr.insert(g);
  for (long long i = n - 2; i >= 1; i--) {
    long long cur = A[i];
    for (long long j = 2; j <= sqrt(cur); j++) {
      if (cur % j == 0) {
        if (pr.count(j)) {
          cout << "setwise coprime";
          return 0;
        }
        pr.insert(j);
      }
      while (cur % j == 0) cur /= j;
    }
    if (cur > 1) {
      if (pr.count(cur)) {
        cout << "setwise coprime";
        return 0;
      }
      pr.insert(cur);
    }
  }
  cout << "pairwise coprime";
  return 0;
}
