#include <bits/stdc++.h>
inline bool IsNum(char x) { return ('0' <= x) && (x <= '9'); }
inline long long ReadNum() {
  long long sign = 1, val = 0;
  char tmp = getchar();
  while (!IsNum(tmp)) {
    if (tmp == '-') {
      sign = -sign;
    }
    tmp = getchar();
  }
  while (IsNum(tmp)) {
    val = val * 10 + tmp - 48;
    tmp = getchar();
  }
  return val * sign;
}
int n, a[1000010];
bool pairwise = true, setwise;
inline int gcd(int _x, int _y) {
  if (_x < _y) std::swap(_x, _y);
  int _z = 0;
  while (_y) _z = _x % _y, _x = _y, _y = _z;
  return _x;
}
int lg2[1000010];
int table[20][1000010];
inline void MakeTable() {
  lg2[1] = 0;
  lg2[2] = 1;
  for (int i = 3; i <= n; i++) {
    lg2[i] = lg2[i >> 1] + 1;
  }
  for (int i = 1; i <= n; i++) {
    table[0][i] = a[i];
  }
  for (int i = 1; i <= lg2[n]; i++) {
    for (int j = 1; j + (1 << i) - 1 <= n; j++) {
      table[i][j] = gcd(table[i - 1][j], table[i - 1][j + (1 << (i - 1))]);
      if (table[i][j] != 1) pairwise = false;
    }
  }
}
inline long long Query(int l, int r) {
  int s = lg2[r - l + 1];
  return gcd(table[s][l], table[s][r - (1 << s) + 1]);
}
inline void Initialize(bool prgmsta) {
  if (!prgmsta) {
  } else {
  }
}
inline void Process() {
  MakeTable();
  setwise = (Query(1, n) == 1) ? true : false;
}
inline void ReadIn() {
  n = ReadNum();
  a[0] = 1;
  for (int i = 1; i <= n; i++) a[i] = ReadNum();
}
inline void PrintAns() {
  if (pairwise)
    puts("pairwise coprime");
  else if (setwise)
    puts("setwise coprime");
  else
    puts("not coprime");
}
int main() {
  Initialize(0);
  ReadIn();
  Initialize(1);
  Process();
  PrintAns();
  return 0;
}
