#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a < b) return gcd(b, a);
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
vector<bool> isprime;
void make_table() {
  isprime[0] = isprime[1] = 0;
  for (long long int i = 2; i < 1000001; i++) {
    if (isprime[i]) {
      for (long long int j = i * i; j < 1000001; j += i) {
        isprime[j] = 0;
      }
    }
  }
}
int main(void) {
  long long int n;
  cin >> n;
  isprime = vector<bool>(1000001, 1);
  vector<long long int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int g = a[0];
  for (int i = 0; i < n; i++) {
    g = gcd(g, a[i]);
  }
  vector<long long int> primes(0);
  make_table();
  for (int i = 0; i < 1000001; i++) {
    if (isprime[i]) primes.emplace_back(i);
  }
  int ok = 1;
  if (n > primes.size() + 1) {
    ok = 0;
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 2; j * j <= a[i]; j++) {
        if (a[i] % j == 0) {
          if (isprime[j] == 0) {
            ok = 0;
          } else {
            isprime[j] = 0;
            while (a[i] % j == 0) {
              a[i] /= j;
            }
          }
        }
      }
      if (a[i] != 1) {
        if (isprime[a[i]] == 0) {
          ok = 0;
        } else {
          isprime[a[i]] = 0;
        }
      }
    }
  }
  if (ok) {
    cout << "pairwise coprime" << endl;
  } else if (g == 1) {
    cout << "setwise coprime" << endl;
  } else
    cout << "not coprime" << endl;
  return 0;
}
