#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> av(n);
  int maxa = 0;
  for (auto& a : av) {
    cin >> a;
    maxa = max(maxa, a);
  }
  vector<bool> check(maxa + 1, true);
  for (int i = 2; i <= maxa; ++i) {
    int temp = i + i;
    while (temp <= maxa) {
      check[i] = false;
      temp += i;
    }
  }
  maxa = sqrt(maxa) + 1;
  bool pc = true;
  bool sc = true;
  for (int i = 2; i <= maxa; ++i) {
    if (!check[i]) {
      continue;
    }
    int temp = 0;
    auto itr = av.begin();
    while (itr != av.end()) {
      int c = 0;
      while ((*itr) % i == 0) {
        (*itr) /= i;
        c = 1;
      }
      temp += c;
      if ((*itr) == 1) {
        itr = av.erase(itr);
      } else {
        ++itr;
      }
    }
    if (1 < temp) {
      pc = false;
      if (temp == n) {
        sc = false;
        break;
      }
      if (av.size() != n) {
        break;
      }
    }
  }
  if (pc) {
    if (1 < av.size()) {
      sort(av.begin(), av.end());
      bool allsame = true;
      bool includesame = false;
      int prev = av[0];
      for (int i = 1; i < av.size(); ++i) {
        if (prev != av[i]) {
          allsame = false;
        } else {
          includesame = true;
        }
        prev = av[i];
      }
      if (includesame) {
        pc = false;
      }
      if (av.size() == n && allsame) {
        sc = false;
      }
    }
  } else if (sc) {
    if (av.size() == n) {
      sort(av.begin(), av.end());
      bool allsame = true;
      int prev = av[0];
      for (int i = 1; i < av.size(); ++i) {
        if (prev != av[i]) {
          allsame = false;
          break;
        }
      }
      if (allsame) {
        sc = false;
      }
    }
  }
  if (pc) {
    cout << "pairwise coprime" << endl;
  } else if (sc) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  return 0;
}
