#include <bits/stdc++.h>
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  qsort(a, n, sizeof(int), cmp);
  int p = a[n - 1];
  int prime[p + 1];
  printf("%d\n", p);
  for (int i = 1; i <= p; i++) prime[i] = 0;
  int b = 0;
  prime[p] = 1;
  for (int i = 0; i < n; i++) {
    int q = a[i];
    int j = 2;
    while (j * j <= q) {
      if (q % j == 0 && prime[j] != 0) {
        b = 1;
        break;
      }
      if (q % j == 0) prime[j] = 1;
      j++;
    }
  }
  if (b == 0) {
    puts("pairwise coprime");
    return 0;
  }
setwise:;
  int g = a[0];
  for (int i = 1; i < n; i++) g = gcd(g, a[i]);
  if (g == 1) {
    puts("setwise coprime");
    return 0;
  }
  puts("not coprime");
  return 0;
}
