#include <bits/stdc++.h>
using namespace std;
std::vector<int> sieve(int n) {
  std::vector<int> res(n);
  std::iota(res.begin(), res.end(), 0);
  for (int i = 2; i * i < n; ++i) {
    if (res[i] < i) continue;
    for (int j = i * i; j < n; j += i)
      if (res[j] == j) res[j] = i;
  }
  return res;
}
std::vector<int> factor(int n, const std::vector<int>& min_factor) {
  std::vector<int> res;
  while (n > 1) {
    res.push_back(min_factor[n]);
    n /= min_factor[n];
  }
  return res;
}
vector<int> divisor(int n) {
  vector<int> ret;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}
template <typename T>
struct PrimeFact {
  vector<T> spf;
  PrimeFact(T N) { init(N); }
  void init(T N) {
    spf.assign(N + 1, 0);
    for (T i = 0; i <= N; i++) spf[i] = i;
    for (T i = 2; i * i <= N; i++) {
      if (spf[i] == i) {
        for (T j = i * i; j <= N; j += i) {
          if (spf[j] == j) {
            spf[j] = i;
          }
        }
      }
    }
  }
  set<T> get(T n) {
    set<T> m;
    while (n != 1) {
      m.insert(spf[n]);
      n /= spf[n];
    }
    return m;
  }
};
int main() {
  int N;
  int A[1001001];
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  set<int> s1;
  set<int> s2;
  bool isPairwiseCoprime = true;
  for (int i = 0; i < N; i++) {
    PrimeFact<int> pf(A[i]);
    set<int> divset = pf.get(A[i]);
    vector<int> div;
    for (auto it = divset.begin(); it != divset.end(); ++it) {
      div.push_back(*it);
    }
    if (isPairwiseCoprime) {
      for (int j = 0; j < div.size(); j++) {
        if (div[j] == 1) {
          continue;
        }
        if (s1.find(div[j]) != s1.end()) {
          isPairwiseCoprime = false;
        } else {
          s1.insert(div[j]);
        }
      }
    }
    if (i == 0) {
      for (int j = 0; j < div.size(); j++) {
        if (div[j] != 1) {
          s2.insert(div[j]);
        }
      }
    } else {
      set<int> divset;
      for (int j = 0; j < div.size(); j++) {
        if (div[j] != 1) {
          divset.insert(div[j]);
        }
      }
      set<int> s3;
      for (auto it = s2.begin(); it != s2.end(); ++it) {
        if (divset.find(*it) != divset.end()) {
          s3.insert(*it);
        }
      }
      s2 = s3;
      if (s2.size() == 0) {
        break;
      }
    }
  }
  if (isPairwiseCoprime) {
    cout << "pairwise coprime" << endl;
  } else if (s2.size() == 0) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  return 0;
}
