#include <bits/stdc++.h>
using namespace std;

vector<bool> x(1e6 + 1, true);
vector<vector<int>> y(1e6 + 1);

// エラトステネスの篩(nは1以上) O(nloglogn)
void sieve(int n) {
  x.at(0) = x.at(1) = false;
  for (int i = 2; i * i <= n; i++) {
    if (x.at(i)) {
      y[i].emplace_back(i);
      for (int j = 2 * i; j <= n; j += i) {
        x.at(j) = false;
        y[j].emplace_back(i);
      }
    }
  }
  // return x;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;
  
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a.at(i);
  
  sieve(1e6);
  for (int i = 2; i <= 1e6; i++) {
    if (y[i].size() == 0) y[i].emplace_back(i);
  }
  
  bool pwise = true;
  vector<bool> used(1e6 + 1, false);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < y[a.at(i)].size(); j++) {
      if (used[y[a.at(i)][j]]) {
        pwise = false;
        break;
      }
      used[y[a.at(i)][j]] = true;
    }
    if (!pwise) break;
  }
  
  if (pwise) {
    cout << "pairwise coprime\n";
    return 0;
  }
  
  int keep = a.at(0);
  for (int i = 1; i < n; i++) keep = gcd(keep, a.at(i));
  
  if (keep == 1) {
    cout << "setwise coprime\n";
    return 0;
  }
  
  cout << "not coprime\n";
  return 0;
}