#include <bits/stdc++.h>
using namespace std;

vector<int> p;

void precompute(const int& n, bool is_c[]) {
  //bool is_c[n + 1] = {};
  //for (int i = 0; i <= n; ++i) is_c[i] = false;
    for (int i = 2; i <= n; ++i) {
        if (!is_c[i]) p.push_back(i);
        for (int j = 0; j < p.size() && p[j] * i <= n; ++j) {
            is_c[i * p[j]] = true;
            if (i % p[j] == 0) break;
        }
    }
}


int main() {
    int n;
    cin >> n;
    int a[n];
    int t(1), mx(1);
    //unordered_set<int> ps;
    bool paired(true);
  //cout << p.size() << endl;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    mx = max(mx, a[i]);
  }
  //cout << mx << endl;
  
         int is_p[mx + 1] = {};
  bool is_c[mx + 1] = {};
  precompute(mx, is_c);
  //cout << p.size() << endl;
    for (int i = 0; i < n; ++i) {
        if (i) {
            t = gcd(t, a[i]);
        } else {
            t = a[i];
        }
      int xx = a[i];
      if (!paired) continue;
      if (!is_c[xx]) {
        if (++is_p[xx] > 1)
          paired = false;
        continue;
      }
        for (int pp: p) {
          //cout << pp << endl;
          if (pp > a[i]) break;
          if (a[i] % pp) continue;
          if (++is_p[pp] > 1) {
            paired = false;
            break;
          }
          while (a[i] % pp == 0) {
            a[i] /= pp;
          }
        }
      /*
        if (a[i] == xx) {
          is_p[xx]++;
          if (is_p[xx] > 1) {
            //cout << 'a' << xx << endl;
            paired = false;
          }
        }*/
    }
    if (t == 1) {
        if (paired) {
            cout << "pairwise coprime\n";
        } else {
            cout << "setwise coprime\n";
        }
    } else {
        cout << "not coprime\n";
    }
    return 0;
};