#include <bits/stdc++.h>
using namespace std;
int prim[1000001], f[1000001], pr2[500000], a[1000001];
int main(void) {
  int n, i, j, mx, gcd, y, b, p, x, flg, ama;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  mx = -1;
  for (i = 0; i < n; i++) mx = max(mx, a[i]);
  for (i = 2; i <= mx; i++) prim[i] = 1;
  for (i = 2; i * i <= mx; i++) {
    if (prim[i] == 1) {
      for (j = 2; j * i <= mx; j++) {
        prim[i * j] = 0;
      }
    }
  }
  p = 0;
  for (i = 2; i <= mx; i++) {
    if (prim[i] == 1) {
      pr2[p] = i;
      p++;
    }
  }
  for (i = 2; i <= mx; i++) f[i] = -1;
  flg = 2;
  for (i = 0; i < n; i++) {
    x = a[i];
    j = 0;
    while (x > 1) {
      if (x % pr2[j] == 0) {
        if (!(f[pr2[j]] == i || f[pr2[j]] == -1)) {
          flg = 0;
          break;
        } else {
          f[pr2[j]] = i;
          x = x / pr2[j];
        }
      } else {
        j++;
        if (pr2[j] > x) break;
      }
    }
    if (flg == 0) break;
  }
  if (flg != 2) {
    gcd = a[0];
    for (i = 1; i < n; i++) {
      x = gcd;
      y = a[i];
      if (x < y) swap(x, y);
      while (1) {
        ama = x % y;
        if (ama == 0) break;
        x = y;
        y = ama;
      }
      gcd = y;
      if (y == 1) {
        flg = 1;
        break;
      }
    }
  }
  if (flg == 2)
    printf("pairwise coprime\n");
  else if (flg == 1)
    printf("setwise coprime\n");
  else
    printf("not coprime\n");
  return 0;
}
