#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(x) ((x).begin()), ((x).end())

#define READ(x) (cin >> (x))
#define WRITE_N(x) (cout << (x) << endl)
#define WRITE(x) (cout << (x))
#define WRITE_YESNO(x) (WRITE_N((x) ? "Yes" : "No"))

#define PRECISE_COUT std::cout << std::setprecision(15) << std::fixed

bool xor_logic(bool x, bool y) { return (x && y) || (!x && !y); }

#define N_MAX 1000000

enum result_t {
  PAIRWISE,
  SETWISE,
  NONE,
};

template <typename T>
class Divider_once {
 private:
  T max_n = 2;
  void init() {
    divider = vector<T>(max_n - 1, -1);
    for (size_t i = 2; i <= max_n; i++) {
      for (auto &&p : primes) {
        if (i % p == 0) {
          set_divider(i, p);
          break;
        } else if (p * p > i) {
          break;
        }
      }

      if (get_divider(i) == -1) {
        set_divider(i, i);
        primes.push_back(i);
      }
    }
  }
  vector<T> divider;
  vector<T> primes;

  void set_divider(T n, T d) { divider[n - 2] = d; }

 public:
  Divider_once(T max_n) {
    this->max_n = max_n;
    init();
  }

  T get_divider(T n) {
    if (n > max_n) {
      return -1;
    }
    return divider[n - 2];
  }
  vector<T> get_prime() { return primes; }

  T get_max() { return max_n; }
};

template <typename T>
map<T, T> factorize(T n, Divider_once<T> &dio) {
  map<T, T> retv;
  if (n > dio.get_max()) {
    retv[-1] = 1;
    return retv;
  }

  while (n != 1) {
    T d = dio.get_divider(n);
    n /= d;
    retv[d]++;
  }

  return retv;
}

bool is_pairwise(const vector<int> &A, const vector<map<int, int>> &factor) {
  unordered_set<int> found_factor;
  for (auto &&x : A) {
    for (auto &&p : factor[x]) {
      if (found_factor.count(p.first) == 0) {
        found_factor.emplace(p.first);
      } else {
        return false;
      }
    }
  }

  return true;
}

bool is_setwise(const vector<int> &A, const vector<map<int, int>> &factor) {
  int min_a = *(min_element(ALL(A)));
  unordered_set<int> min_factor;
  for (auto &&p : factor[min_a]) {
    min_factor.emplace(p.first);
  }

  for (auto &&x : A) {
    auto fac_a = factor[x];
    unordered_set<int> erase_factor;
    for (auto &&f : min_factor) {
      if (fac_a.count(f) == 0) {
        erase_factor.emplace(f);
      }
    }

    for (auto &&f : erase_factor) {
      min_factor.erase(f);
    }
    if (min_factor.empty()) {
      return true;
    }
  }

  return false;
}

result_t solve(vector<int> &A) {
  Divider_once<int> divider_once(N_MAX);
  vector<map<int, int>> factor(N_MAX);

  for (size_t i = 2; i <= N_MAX; i++) {
    factor[i] = factorize<int>(i, divider_once);
  }

  if (is_pairwise(A, factor)) {
    return PAIRWISE;
  } else if (is_setwise(A, factor)) {
    return SETWISE;
  }
  return NONE;
}

int main() {
  // get values from input
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  cin >> N;

  std::vector<int> A(N, 0);
  for (size_t i = 0; i < N; i++) {
    cin >> A[i];
  }

  // main procedure
  result_t ans = solve(A);

  // output
  switch (ans) {
    case PAIRWISE:
      cout << "pairwise coprime" << endl;
      break;
    case SETWISE:
      cout << "setwise coprime" << endl;
      break;
    default:
      cout << "not coprime" << endl;
      break;
  }

  return 0;
}

Measured memory_bytes: 191852