#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[1000001];
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
bool ispairwise() {
  long long last = 1;
  for (long long i = 0; i < n - 1; i++) {
    if (gcd(last, a[i + 1]) != 1) return false;
    if (gcd(a[i], a[i + 1]) != 1) return false;
    last = a[i];
  }
  return true;
}
bool issetwise() {
  long long res = a[0];
  for (long long i = 0; i < n; i++) {
    res = gcd(res, a[i]);
  }
  return res == 1;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long isp = ispairwise();
  long long iss = issetwise();
  if (isp)
    cout << "pairwise coprime" << endl;
  else if (iss && !isp)
    cout << "setwise coprime" << endl;
  else
    cout << "not coprime" << endl;
  return 0;
}
