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


bool checkCoprime(int a, int b) {
    int m = min(a, b);
    
    if (m == 1) {return true;}
    
    for (int i = 2; i <= m; i++) {
        if ((a % i == 0) && (b % i == 0)) {
            return false;
        }
    }
    return true;
}

int gcd_arr(vector<int> &a){
  int n = a.size();
  for(int i=n-2; i>=0; i--){
    a[i] = gcd(a[i], a[i+1]);
  }
  return a.front();
}

int main(){
    int N;
    cin >> N;
    
    vector<int> A(N);
    int a = 0, count = 0;
    for (int i = 0; i < N; i++) {
        cin >> a;
        A.at(i) = a;
        for (int k = 0; k < i; k++) {
            if (checkCoprime(A.at(k), a)) {
                count++;
            }
        }
    }
    if (count == N*(N-1)/2) {
        cout << "pairwise coprime" << endl;
    } else if (count > 0) {
        if (gcd_arr(A) > 1) {
        cout << "setwise coprime" << endl;
            
        }
    } else {
        cout << "not coprime" << endl;
    }

}
