#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (ll i = 0; i < n; i++) cin >> a[i];
  int P_MAX = 1000005;
  vector<int> pmn(P_MAX, -1);
  for (int i = 1; i < P_MAX; i++)
    if (i % 2 == 0)
      pmn[i] = 2;
    else
      pmn[i] = i;
  for (int i = 3; i * i < P_MAX; i += 2) {
    if (pmn[i] == i) {
      for (int j = 3 * i; j < P_MAX; j += 2 * i)
        if (pmn[j] == j) pmn[j] = i;
    }
  }
  int flag = 2;
  vector<int> cnt(P_MAX, 0);
  for (ll i = 0; i < n; i++) {
    cnt[pmn[a[i]]]++;
    if (flag == 2 && cnt[pmn[a[i]]] > 1) flag = 1;
  }
  if (flag == 1 && cnt[pmn[a[0]]] == n) flag = 0;
  if (flag == 2) {
    puts("pairwise coprime");
  } else if (flag == 1) {
    puts("setwise coprime");
  } else {
    puts("not coprime");
  }
}
