#include <bits/stdc++.h>
using namespace std;
long long MOD = 10000000000 + 7;
template <typename T>
map<T, int> prime_factorize(T x) {
  map<T, int> res;
  while (x % 2 == 0) {
    x /= 2;
    res[2]++;
  }
  for (int i = 3; i * i <= x; i += 2) {
    while (x % i == 0) {
      x /= i;
      res[i]++;
    }
  }
  if (x != 1) res[x]++;
  return res;
}
map<int, int> merge_map(map<int, int> m1, map<int, int> m2) {
  map<int, int> m;
  for (auto x : m1) {
    m[x.first] = 1;
  }
  for (auto x : m2) {
    m[x.first] = 1;
  }
  return m;
}
template <typename T>
T gcd(T a, T b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  cout << setprecision(10);
  int N;
  cin >> N;
  vector<int> A;
  map<int, int> m;
  bool pairwise_flg = true;
  bool setwise_flg = true;
  int gcd_val;
  int one_count = 0;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    if (tmp == 1) {
      one_count++;
    } else {
      A.push_back(tmp);
    }
  }
  if (one_count == N) {
    cout << "pairwise coprime" << endl;
    return 0;
  }
  N = A.size();
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      m = prime_factorize(A[i]);
    } else {
      map<int, int> m_tmp1, m_tmp2;
      m_tmp1 = prime_factorize(A[i]);
      m_tmp2 = merge_map(m, m_tmp1);
      if (m.size() + m_tmp1.size() == m_tmp2.size()) {
      } else {
        pairwise_flg = false;
        break;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      gcd_val = A[i];
    } else {
      gcd_val = gcd(gcd_val, A[i]);
    }
  }
  setwise_flg = (gcd_val == 1);
  if (one_count > 0) {
    setwise_flg = true;
  }
  if (pairwise_flg) {
    cout << "pairwise coprime" << endl;
  } else if (setwise_flg) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
}
