#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <math.h>
using namespace std;

vector<int> A;
map<int, int> M;

void calc(int number) {
    for(int i = 2; i <= sqrt(number)+1; i++) {
        while(number % i == 0) {
            M[i]++; number /= i;
        }
    }
    if(number > 1)
        M[number]++;
}

int main() {
    int N; cin >> N; A.resize(N);

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

    int g = A[0];
    for(int i = 1; i < N; i++) {
        g = __gcd(g, A[i]);
    }

    M.clear();
    calc(A[N-1]);

    bool flag = 0; int cnt = 0;
    for(int i = N-2; i >= 0; i--) {
        int temp = A[i];
        flag = 0;
        // cout << "I = " << i << ":\t";
        for(auto m : M) {
            // cout << m.first << "\t";
            if(temp % m.first == 0) {
                flag = 1; 
                while(temp % m.first == 0) {
                    M[m.first]++;
                    temp /= m.first;
                }
            }
        }

        // cout << "Cnt = " << cnt << "\n";

        calc(temp);
        if(!flag) {
            cnt++;
        }
    }

    if(cnt == N-1) {
        cout << "pairwise coprime"; return 0;
    }

    if(g == 1) {
        cout << "setwise coprime"; return 0;
    }

    cout << "not coprime";

    return 0;
}