#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  int t;
  while (x % y) t = x, x = y, y = t % y;
  return y;
}
const int N = 1e6 + 1;
bool prime[N + 10];
vector<int> k;
bool present[N + 10];
void sieve() {
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= N; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= N; i += p) {
        prime[i] = false;
      }
    }
  }
  for (int p = 2; p <= N; p++)
    if (prime[p]) k.emplace_back(p);
}
bool pairwisecoprime(int arr[], int n) {
  for (int i = (n)-1; i >= 0; i--) {
    int val = arr[i];
    if (present[val] == true && val != 1) {
      return false;
    }
    for (auto x : k) {
      if (val % x == 0) {
        if (present[x] == true) return false;
        present[x] = true;
        while (val % x == 0) {
          present[val] = true;
          val /= x;
        }
      }
      if (val == 1) break;
    }
  }
  return true;
}
bool setwisecoprime(int arr[], int n) {
  int g = arr[0];
  for (int i = (1); i < (n); i++) {
    g = gcd(g, arr[i]);
    if (g == 1) break;
  }
  if (g == 1)
    return true;
  else
    return false;
}
void solve() {
  sieve();
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < (n); i++) cin >> arr[i];
  if (pairwisecoprime(arr, n)) {
    cout << "pairwise coprime" << endl;
  } else if (setwisecoprime(arr, n)) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) solve();
}
