#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
long long int power(long long int a, long long int b) {
  long long int res = 1;
  a = a % 1000000007;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
      b--;
    }
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  return (b == 0) ? a : gcd(b, a % b);
}
vector<long long int> pos(1000006, -1);
vector<long long int> fin(1000006, 0);
vector<long long int> spf(1000006);
vector<long long int> v(1000006);
long long int n;
vector<bool> vis(1000006, false);
void sieve() {
  for (long long int i = 2; i < 10000; i++) {
    if (!vis[i]) {
      for (long long int j = i; j < 1000005; j += i) {
        if (pos[j] != -1) fin[i] = max(fin[i], pos[j]);
        spf[j] = min(spf[j], i);
        vis[j] = true;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> v[i];
    pos[v[i]] = i;
    spf[v[i]] = v[i];
  }
  sieve();
  int f = 0;
  for (long long int i = 0; i < n; i++) {
    long long int cur = v[i];
    while (cur > 1) {
      long long int d = spf[cur];
      if (fin[spf[cur]] > i) {
        f = 1;
        break;
      }
      while (cur % d == 0) cur = cur / d;
    }
    if (f == 1) break;
  }
  if (f == 0) {
    cout << "pairwise coprime"
         << "\n";
    return 0;
  }
  long long int ans = v[0];
  for (long long int i = 1; i < n; i++) ans = gcd(ans, v[i]);
  if (ans == 1) {
    cout << "setwise coprime\n";
    return 0;
  }
  cout << "not coprime\n";
}
