#include <bits/stdc++.h>
using namespace std;
const long long vsize = 1000003;
vector<bool> sievevect(vsize, 0);
void sieve() {
  sievevect[2] = 1;
  ;
  for (long long i = 3; i < vsize; i += 2) sievevect[i] = 1;
  for (long long i = 3; i < vsize; i += 2)
    if (sievevect[i] == 1) {
      for (long long j = i * i; j < vsize; j += i) sievevect[j] = 0;
    }
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  sieve();
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i += 1) cin >> v[i];
  vector<long long> prime(n);
  if (sievevect[v[0]] == 1) prime[0] = 1;
  for (long long i = 1; i < n; i += 1) {
    long long x = 0;
    if (sievevect[v[i]] == 1) x = 1;
    prime[i] = prime[i - 1] + x;
  }
  long long c = 0;
  for (long long i = 0; i < n - 1; i += 1) {
    if (sievevect[v[i]] == 1)
      c++;
    else {
      if (prime[n - 1] - prime[i] == (n - i - 1)) c++;
    }
  }
  if (c == n - 1)
    cout << "pairwise coprime";
  else {
    long long g = gcd(v[0], v[1]);
    for (long long i = 2; i < n; i += 1) g = gcd(g, v[i]);
    if (g == 1)
      cout << "setwise coprime";
    else
      cout << "not coprime";
  }
  return 0;
}
