#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
const int MAX_INT = 1000000;
int is_prime[MAX_INT + 1];
vector<int> P;
void calc(int N) {
  while (-1 != is_prime[N]) {
    int p = is_prime[N];
    while (0 == N % p) {
      N /= p;
    }
    mp[p]++;
  }
  if (-1 != N) {
    mp[N]++;
  }
  return;
}
void sieve(int n) {
  is_prime[0] = -1;
  is_prime[1] = -1;
  for (int m = 2; m <= n; ++m) {
    is_prime[m] = -1;
  }
  for (int m = 2; m <= n; ++m) {
    if (-1 == is_prime[m]) {
      P.push_back(m);
      for (int l = 2 * m; l <= n; l += m) {
        is_prime[l] = m;
      }
    }
  }
  return;
}
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  int maxA = 0;
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
    maxA = max(maxA, A[i]);
  }
  sieve(maxA);
  cout << P.size() << endl;
  for (int i = 0; i < N; ++i) {
    calc(A[i]);
  }
  bool b1 = true;
  bool b2 = false;
  for (auto p : mp) {
    if (1 != p.second) {
      b1 = false;
    }
    if (N == p.second) {
      b2 = true;
    }
  }
  if (b1) {
    cout << "pairwise coprime" << endl;
  } else if (!b2) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  return 0;
}
