#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else {
    return gcd(b, a % b);
  }
}
int main() {
  int N;
  int a;
  int res = 0;
  int count = 0;
  cin >> N;
  vector<int> vect;
  for (int i = 0; i < N; i++) {
    cin >> a;
    vect.push_back(a);
  }
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      int ans = gcd(vect[i], vect[j]);
      if (ans == 1) count++;
    }
  }
  long long int total = (N * (N - 1)) / 2;
  if (count == total)
    cout << "pairwise coprime" << endl;
  else {
    res = vect[0];
    for (int i = 0; i < N; i++) {
      int j = i + 1;
      res = gcd(res, vect[j]);
    }
    if (res == 1)
      cout << "setwise coprime" << endl;
    else {
      cout << "Neither" << endl;
    }
  }
  return 0;
}
