#include<bits/stdc++.h>
#define int long long
#define MOD 1000000007
using namespace std;

bool getPC(vector<int> &vec){
    map<int, bool> visited;
    for(int i = 0; i < vec.size(); i++){
        for(int j = 2; j <= sqrt(vec[i]); j++){
            if(vec[i] % j) continue;
            if(visited[j]) return false;
            visited[j] = true;
            while(vec[i] % j == 0){
                vec[i] /= j;
            }
        }
        visited[vec[i]] = true;
    }
    return true;
}

bool getSC(vector<int> &vec){
    int temp = vec[0];
    for(int i = 1; i < vec.size(); i++){
        temp = __gcd(temp, vec[i]);
    }
    return temp == 1;
}

int32_t main() {
    int n;
    cin >> n;
    vector<int> vec(n);
    for(int i = 0; i < n; i++){
        cin >> vec[i];
    }
    bool sc = getSC(vec);
    bool pc = getPC(vec);
    if(pc){
        cout << "pairwise coprime" << endl;
    }else if(sc){
        cout << "setwise coprime" << endl;
    }else{
        cout << "not coprime" << endl;
    }
}