#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::vector<int> A(N);
  for (int i = 0; i < N; i++) {
    std::cin >> A[i];
  }
  std::vector<bool> PM(1e6 + 1, true);
  std::vector<int> PM_list;
  std::vector<int> PM_list_sqrt;
  std::map<int, int> PM_map;
  for (int i = 2; i <= 1e6; i++) {
    if (PM[i]) {
      PM_list.push_back(i);
      if (i <= 1000) {
        PM_list_sqrt.push_back(i);
      }
      PM_map[i] = 0;
      for (int j = i + i; j <= 1e6; j += i) {
        PM[j] = false;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    while (A[i] != 1) {
      auto find_itr = PM_map.find(A[i]);
      if (find_itr != PM_map.end()) {
        PM_map[find_itr->first]++;
        A[i] = 1;
      } else {
        for (int j = 0; j < PM_list_sqrt.size(); j++) {
          if (A[i] % PM_list_sqrt[j] == 0) {
            while (A[i] % PM_list_sqrt[j] == 0) {
              A[i] /= PM_list_sqrt[j];
            }
            PM_map[PM_list_sqrt[j]]++;
            break;
          }
        }
      }
    }
  }
  int f = 2;
  for (int j = 0; j < PM_list.size(); j++) {
    if (PM_map[PM_list[j]] == N) {
      f = 0;
    } else if (PM_map[PM_list[j]] > 1) {
      f = 1;
    }
  }
  if (f == 2) {
    std::cout << "pairwise coprime" << std::endl;
  } else if (f == 1) {
    std::cout << "setwise coprime" << std::endl;
  } else {
    std::cout << "not coprime" << std::endl;
  }
  return 0;
}
