#include <bits/stdc++.h>
using namespace std;
const int MX = 1e6 + 5;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n), cnt(MX);
  int tot_gcd = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    tot_gcd = (i == 0 ? a[i] : gcd(tot_gcd, a[i]));
    cnt[a[i]]++;
  }
  vector<bool> is_prime(MX, 1);
  is_prime[0] = is_prime[1] = 0;
  for (int i = 2; i < MX; ++i) {
    if (!is_prime[i]) continue;
    for (int j = 2 * i; j < MX; j += i) {
      is_prime[j] = 0;
    }
  }
  vector<int> primes;
  primes.reserve(MX);
  for (int i = 2; i < MX; ++i) {
    if (is_prime[i]) {
      primes.push_back(i);
    }
  }
  bool found = false;
  for (int prime : primes) {
    int p_cnt = 0;
    for (int i = prime; i < MX && p_cnt < 2; i += prime) {
      p_cnt += cnt[i];
    }
    if (p_cnt == 2) {
      found = true;
      break;
    }
  }
  if (!found) {
    cout << "pairwise coprime\n";
  } else if (tot_gcd == 1) {
    cout << "setwise coprime\n";
  } else {
    cout << "not coprime\n";
  }
  return 0;
}
