#include <bits/stdc++.h>
const int MAX_N = 1000005;
int N;
int vals[MAX_N];
int prime_arr[MAX_N];
int prime_cts2[MAX_N];
int prime_cts[MAX_N];
std::vector<int> primes;
int main() {
  for (int64_t i = 2; i < MAX_N; ++i) {
    if (prime_arr[i]) continue;
    for (int64_t j = i * i; j < MAX_N; j += i) prime_arr[j] = true;
    primes.push_back(i);
  }
  scanf("%d", &N);
  bool pairwise = true;
  bool setwise = true;
  for (int i = 0; i < N; ++i) {
    scanf("%d", vals + i);
    int v = vals[i];
    int idx = 0;
    while (v > 1) {
      if (v % primes[idx] == 0 && prime_cts[primes[idx]]) pairwise = false;
      bool had_prime = false;
      while (v % primes[idx] == 0) {
        had_prime = true;
        v /= primes[idx];
      }
      if (had_prime) {
        prime_cts[primes[idx]] = 1;
        prime_cts2[primes[idx]] += 1;
        if (prime_cts2[primes[idx]] == N) setwise = false;
      }
      idx++;
    }
  }
  if (pairwise)
    printf("pairwise coprime\n");
  else if (setwise)
    printf("setwise coprime\n");
  else
    printf("not coprime\n");
}
