#include <iostream>
#include <numeric>
#include <vector>
using namespace std;

string pairwise(vector<int> A){
    long long c(0);
    for (int i = 0,size = (A.size() - 1); i < size; ++i) c += std::gcd(A[i],A[i + 1]);
    if(c == (long long)(A.size() - 1)){
        return "pairwise coprime";
    }else{
        return "not coprime";
    }
}

string setwise(long long a, vector<int> A, int i){
    long long _a = std::gcd(a,A[i]);
    if(_a != 1 || ((int)(A.size() - 1) != i)) return setwise(_a,A,++i);
    else if(_a == 1 || ((int)(A.size() - 1) == i)) return "setwise coprime";
    else return "";
}


int main() {
    int N;
    string intAryStr,ans;
    cin >> N;
    vector<int> A(N);

    for(int i = 0; i < N; ++i) cin >> A[i];

    ans = pairwise(A);

    if(setwise(A[0],A,0) == "") {
        cout << ans << endl;
    }else{
        cout << "setwise coprime" << endl;
    }



    return 0;
}
