#include <bits/stdc++.h>
using namespace std;
using ll = long long;
double PI = acos(-1.0);
int INF = 1e9;
ll LINF = 1e18;
ll MOD = 1e9 + 7;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  ll n, a, flag = 0;
  cin >> n;
  vector<ll> table(1e6 + 1, 0);
  for (ll i = 0; i < (n); i++) {
    cin >> a;
    ll j = 2;
    ll t = a;
    while (j * j <= t) {
      if (t % j == 0) {
        while (t % j == 0) t /= j;
        table[j]++;
        if (table[j] > 1 && flag == 0) flag++;
        if (i == n - 1)
          if (table[j] == n && flag <= 1) flag = 2;
      }
      j++;
    }
    table[t]++;
    if (table[t] > 1 && flag == 0) flag++;
    if (i == n - 1)
      if (t != 1 && table[t] == n && flag <= 1) flag = 2;
  }
  if (flag == 0)
    cout << "pairwise coprime" << endl;
  else if (flag == 1)
    cout << "setwise coprime" << endl;
  else
    cout << "not coprime" << endl;
  return 0;
}
