#include <bits/stdc++.h>
using namespace std;
int t[1000001], p[1000001], cnt = 0;
int a[1000001];
int c[1000001];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> t[i];
  for (int i = 1; i <= 1000000; i++) a[i] = i;
  for (int i = 2; i <= 1000000; i++) {
    if (a[i] == i) p[++cnt] = i;
    for (int j = 1; j <= cnt && p[j] <= a[i] && i * p[j] <= 1000000; j++)
      a[i * p[j]] = p[j];
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= cnt && p[j] <= t[i]; j++)
      if (t[i] % p[j] == 0) {
        c[j]++;
        while (t[i] % p[j] == 0) t[i] /= p[j];
      }
  bool f1 = true, f2 = true;
  for (int i = 1; i <= cnt; i++) {
    if (c[i] > 1) f1 = false;
    if (c[i] == n) f2 = false;
  }
  if (f1)
    cout << "pairwise coprime";
  else if (f2)
    cout << "setwise coprime";
  else
    cout << "not coprime";
  return 0;
}
