#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int gcd(int m, int n) {
  if (n == 0) return m;
  return gcd(n, m % n);
}
int comprime(int s, int g, int &cmprm, vector<int> &A) {
  if (g - s < 2) {
    cmprm = 1;
    return A[s];
  }
  int piv = (g + s) / 2;
  int cmprm1, cmprm2;
  int r = gcd(comprime(s, piv, cmprm1, A), comprime(piv, g, cmprm2, A));
  if (r == 1 & cmprm1 * cmprm2 != 1)
    cmprm = 2;
  else if (r != 1)
    cmprm = 3;
  return r;
}
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < (N); ++i) cin >> A[i];
  int cmprm = 1;
  int r = comprime(0, N, cmprm, A);
  cout << r << cmprm << endl;
  if (cmprm == 1)
    cout << "pairwise comprime" << endl;
  else if (cmprm == 2)
    cout << "serwise comprime" << endl;
  else
    cout << "not comprime" << endl;
  return 0;
}
