#include <bits/stdc++.h>
using namespace std;
int a[1000003];
int b[1000003];
int z[1000003];
int cnt;
int bb;
void fj(int x) {
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      if (b[i] >= 1)
        bb = 1, b[i]++;
      else {
        z[++cnt] = i;
        b[i] = 1;
      }
    }
    while (x % i == 0) {
      x /= i;
    }
  }
  if (x > 1) {
    if (b[x] >= 1) {
      bb = 1;
      b[x]++;
    }
    b[x] = 1;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = n; i >= 1; i--) fj(a[i]);
  int Max = 0;
  for (int i = 1; i <= cnt; i++) Max = max(Max, b[z[i]]);
  if (bb == 0)
    cout << "pairwise coprime\n";
  else if (Max != n)
    cout << "setwise coprime\n";
  else
    cout << "not coprime\n";
}
