#include <bits/stdc++.h>
using namespace std;
struct cww {
  cww() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  }
} star;
const long long INF = numeric_limits<long long>::max();
std::vector<bool> IsPrime;
void sieve(size_t max) {
  if (max + 1 > IsPrime.size()) {
    IsPrime.resize(max + 1, true);
  }
  IsPrime[0] = false;
  IsPrime[1] = false;
  for (size_t i = 2; i * i <= max; ++i)
    if (IsPrime[i])
      for (size_t j = 2; i * j <= max; ++j) IsPrime[i * j] = false;
}
int main() {
  int N;
  cin >> N;
  vector<int> A;
  int tmp = 0;
  int maxnum = 0;
  for (int i = 0; i < (N); i++) {
    cin >> tmp;
    maxnum = max(maxnum, tmp);
    A.push_back(tmp);
  }
  set<int> primenum;
  primenum.insert(2);
  primenum.insert(3);
  for (int i = 5; i < (maxnum + 1); i++) {
    bool isdiv = false;
    for (int p : primenum) {
      if (p > sqrt(i) + 1) {
        break;
      }
      if (i % p == 0) {
        isdiv = true;
        break;
      }
    }
    if (!isdiv) {
      primenum.insert(i);
    }
  }
  map<int, int> primes;
  for (int i = 0; i < (N); i++) {
    int num = A[i];
    for (int p : primenum) {
      if (num % p == 0) {
        if (primes.count(p)) {
          primes[p]++;
        } else {
          primes[p] = 1;
        }
      } else {
        continue;
      }
    }
  }
  bool ispairwise = true;
  bool issetwise = true;
  cout << primes.size() << endl;
  for (pair<int, int> p : primes) {
    cout << p.first << ":" << p.second << endl;
    if (p.second != 1) {
      ispairwise = false;
    }
    if (p.second == N) {
      issetwise = false;
    }
  }
  if (ispairwise) {
    cout << "pairwise coprime" << endl;
    return 0;
  }
  if (issetwise) {
    cout << "setwise coprime" << endl;
    return 0;
  }
  cout << "not coprime" << endl;
  return 0;
}
