#include <bits/stdc++.h>
using namespace std;

using vi = vector<int>;
using ii = pair<int, int>;

#define MAX 1000010

const int MOD = 1e9 + 7;

using ll = long long;

bitset<MAX> prime;

vi primes;

void sieve(int n) {
  primes.push_back(2);
  prime.set();

  int i;
  for (i = 3; i * i <= n; i += 2) {
    if (prime[i]) {
      primes.push_back(i);
      for (int j = i * i; j <= n; j += i)
        prime[j] = 0;
    }
  }

  for (; i <= n; i += 2)
    if (prime[i])
      primes.push_back(i);
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n;
  cin >> n;
  vi v(n);

  int mx = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mx = max(mx, v[i]);
  }

  sieve(mx + 1);

  vector<char> used(primes.size(), false);

  bool pairwise = true;
  int gcd;
  for (int i = 0; i < n; i++) {
    if (i == 0) gcd = v[i];
    else if (gcd > 1)
      gcd = __gcd(gcd, v[i]);

    if (!pairwise) {
      if (gcd == 1) break;
      continue;
    }

    for (int j = 0; v[i] > 1 && j < (int) primes.size(); j++) {
      int &p = primes[j];
      if (v[i] % p == 0) {
        if (used[j]) {
          pairwise = false;
          break;
        }
        used[j] = true;
      }

      while (v[i] > 1 && v[i] % p == 0)
        v[i] /= p;
    }
  }

  if (pairwise)
    cout << "pairwise coprime" << endl;
  else if (gcd == 1)
    cout << "setwise coprime" << endl;
  else
    cout << "not coprime" << endl;

  return 0;
}
