#include <iostream>
#include <bits/stdc++.h>

using namespace std;

void solve(){

    int n; cin >> n;
    int arr[n];
    for(int i = 0; i < n; ++i) cin >> arr[i];

    int setwise = arr[0];
    for(int i = 1; i < n; ++i) setwise = __gcd(setwise, arr[i]);
    if(setwise != 1){
        cout << "not coprime\n";
        return;
    }

    int lim = *max_element(arr, arr+n);
    vector<bool> pres (lim+1, false);

    int flag = true;
    for(int i = n-1; i >= 0 && flag; --i){
        int num = arr[i];
        int sqr_i = sqrt(num);
        int fac = 2;
        while(fac <= min(sqr_i, num)){
            if(num % fac == 0){
                if(pres[fac]){
                    flag = false;
                    break;
                }
                while(num % fac == 0) num /= fac;
                pres[fac] = true;
            }
            ++fac;
        }
    }
    cout << (flag ? "pairwise coprime\n" : "setwise coprime\n");

}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    solve();

	return 0;
}