#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  vector<int> a;
  int min_val = 1000000;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
    if (min_val > x) {
      min_val = x;
    }
  }
  vector<int> primes;
  int b[min_val];
  for (int i = 0; i < min_val; i++) {
    b[i] = 0;
  }
  for (int i = 2; i < min_val; i++) {
    primes.push_back(i);
    for (int j = 2; i * j < min_val; j++) {
      b[i] = 1;
    }
    while (i < min_val && b[i] == 1) {
      i++;
    }
  }
  vector<int> count;
  for (int i = 0; i < primes.size(); i++) {
    count.push_back(0);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < primes.size(); j++) {
      if (a[i] % primes[j] == 0) {
        count[j]++;
      }
    }
  }
  int ans1 = 1, ans2 = 1;
  for (int i = 0; i < count.size(); i++) {
    if (count[i] > 1) {
      ans1 = 0;
    }
    if (count[i] == n) {
      ans2 = 0;
    }
  }
  cout << ans1 << " " << ans2 << "\n";
  if (ans2 == 0) {
    cout << "not coprime";
  } else if (ans1 == 0) {
    cout << "setwise coprime";
  } else {
    cout << "pairwise coprime";
  }
  return 0;
}
