#include <bits/stdc++.h>
using namespace std;
bool isPrime[1000001];
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
void sieve() {
  memset(isPrime, 1, sizeof(isPrime));
  isPrime[0] = isPrime[1] = 0;
  for (int i = 2; i * i <= 1000000; i++) {
    if (isPrime[i]) {
      for (int j = i * i; j <= 1000000; j += i) {
        isPrime[j] = 0;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int t, n;
  sieve();
  isPrime[1] = 1;
  t = 1;
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    int arr[n], cnt[n];
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    int gcdd;
    for (int i = n - 1; i >= 0; i--) {
      if (i == n - 1) {
        gcdd = arr[i];
        cnt[i] = 0;
      } else {
        if (isPrime[arr[i + 1]]) {
          cnt[i] = cnt[i + 1] + 1;
        } else {
          cnt[i] = cnt[i + 1];
        }
        gcdd = gcd(gcdd, arr[i]);
      }
    }
    int x = 0;
    for (int i = 0; i < n; i++) {
      if (isPrime[arr[i]] || cnt[i] == n - i - 1) {
        x++;
      }
    }
    if (x == n) {
      cout << "pairwise coprime";
    } else if (gcdd == 1) {
      cout << "setwise coprime";
    } else {
      cout << "not coprime";
    }
  }
  return 0;
}
