#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ull = uint64_t;
const ll INF = 9e18;
void print() { cout << endl; }
template <typename Head, typename... Tail>
void print(Head head, Tail... tail) {
  int size = sizeof...(Tail);
  cout << head;
  if (size > 0) {
    cout << " ";
  }
  print(tail...);
}
void print0() {}
template <typename Head, typename... Tail>
void print0(Head head, Tail... tail) {
  cout << head;
  print0(tail...);
}
vector<ll> mkprimes(ll N) {
  vector<bool> isprime(N + 1);
  vector<ll> primes;
  for (ll i = 0; i <= N; i++) {
    isprime[i] = true;
  }
  isprime[0] = false;
  isprime[1] = false;
  for (ll i = 2; i <= N; i++) {
    if (isprime[i]) {
      primes.push_back(i);
      for (ll j = 2 * i; j <= N; j += i) {
        isprime[j] = false;
      }
    }
  }
  return primes;
}
const ll NMAX = 1000000;
int main() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  for (ll i = 0; i < N; i++) {
    cin >> A[i];
  }
  ll AM = 1000000;
  auto primes = mkprimes(AM);
  vector<bool> primes2(AM, false);
  for (auto p : primes) {
    primes2[p] = true;
  }
  {
    bool pc = true;
    stack<ll> notused_a;
    stack<ll> notused_b;
    auto notused_current = &notused_a;
    auto notused_next = &notused_b;
    for (auto p : primes) {
      notused_a.push(p);
    }
    for (ll i = 0; i < N; i++) {
      ll ai = A[i];
      while (!notused_current->empty()) {
        ll p = notused_current->top();
        notused_current->pop();
        bool u = false;
        while (ai % p == 0) {
          ai = ai / p;
          u = true;
        }
        if (!u) {
          notused_next->push(p);
        }
      }
      if (ai != 1 && !primes2[ai]) {
        pc = false;
      }
      swap(notused_next, notused_current);
    }
    if (pc) {
      print("pairwise coprime");
      return 0;
    }
  }
  {
    bool nc = true;
    stack<ll> used_a;
    stack<ll> used_b;
    auto used_current = &used_a;
    auto used_next = &used_b;
    for (auto p : primes) {
      used_a.push(p);
    }
    for (ll i = 0; i < N; i++) {
      ll ai = A[i];
      while (!used_current->empty()) {
        ll p = used_current->top();
        used_current->pop();
        if (ai % p == 0) {
          used_next->push(p);
        }
      }
      if (used_next->empty()) {
        nc = false;
      }
      swap(used_next, used_current);
    }
    if (nc) {
      print("not coprime");
      return 0;
    } else {
      print("setwise coprime");
      return 0;
    }
  }
}
