#include <bits/stdc++.h>
using namespace std;
int s[1000001] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  ;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int tmp[n];
  copy(a, a + n, tmp);
  int check[n];
  memset(check, 0, sizeof(check));
  int setg = 0;
  int flag = 1;
  bitset<32> f[n];
  for (int i = 0; i < n; i++) {
    for (int j = 2; j < int(sqrt(tmp[i])) + 1; j++) {
      if (tmp[i] % j == 0) {
        while (tmp[i] % j == 0) {
          tmp[i] /= j;
        }
        f[i][j] = 1;
      }
    }
    if (tmp[i] > 1) f[i][tmp[i]] = 1;
  }
  bitset<32> test;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if ((f[i] & f[j]) != test) {
        flag = 0;
        break;
      }
    }
  }
  bitset<32> one;
  one = f[0];
  for (int i = 1; i < n; i++) {
    one = (one & f[i]);
  }
  if (one == test) setg = 1;
  if (flag == 1)
    cout << "pairwise coprime\n";
  else if (flag == 0 && setg == 1)
    cout << "setwise coprime\n";
  else if (flag == 0 && setg != 1)
    cout << "not coprime\n";
}
