#include <bits/stdc++.h>
using namespace std;
int n;
int* arr;
bool gcd(int i) {
  int j;
  for (j = i + 1; j < n; j++) {
    if (arr[i] == arr[j]) {
      if (arr[i] != 1)
        return false;
      else
        continue;
    } else {
      int mini = ((arr[i] > arr[j]) ? arr[j] : arr[i]) / 2;
      for (int k = 2; k <= mini; k++) {
        if (arr[i] % k == 0 || arr[j] % k == 0) return false;
      }
    }
  }
  return true;
}
int mini_num() {
  int mini_num = arr[0];
  for (int i = 1; i < n; i++) {
    mini_num = (mini_num > arr[i]) ? arr[i] : mini_num;
  }
  return mini_num;
}
int main() {
  bool coprime = true;
  bool setprime = true;
  cin >> n;
  arr = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < n; i++) {
    cout << gcd(i) << endl;
    if (!gcd(i)) {
      coprime = false;
      break;
    }
  }
  int check = mini_num() / 2;
  for (int i = 2; i <= check; i++) {
    int counter = 0;
    for (int j = 0; j < n; j++) {
      if ((arr[j] % i) == 0) {
        counter++;
      }
    }
    if (counter == n) {
      setprime = false;
      break;
    }
  }
  if (coprime)
    cout << "pairwise coprime" << endl;
  else if (setprime)
    cout << "setwise coprime" << endl;
  else
    cout << "not coprime" << endl;
  return 0;
}
