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

int main(){
    long long n;
    string ans = "not coprime";
    cin >> n;
    
    vector<int> vec(n);
    bool flg1 = true;
    for (int i = 0; i < n; i++) {
        cin >> vec[i];
        if (i == 0 || flg1 == false) {
            continue;
        } else {
            int buf1 = gcd(vec[i], vec[i - 1]);
            int buf2 = gcd(vec[0], vec[i]);
            if (buf1 != 1 || buf2 != 1) {
                flg1 = false;
            }
        }
    }
    
    bool flg2 = true;
    if (flg1 == true) {
        for (int i = 1; i < n - 2; i++) {
            for (int j = i + 2; j < n; j++) {
                if (gcd(vec[i], vec[j]) != 1) {
                    flg2 = false;
                    break;
                }
            }
            if (flg2 == false) break;
        }
    }
    
    if (flg1 == true && flg2 == true) {
        cout << "pairwise coprime" << endl;
        return 0;
    }
    
    int buf3;
    for (int i = 1; i < n; i++) {
        if (i == 1) {
            buf3 = gcd(vec[0], vec[1]);
        } else {
            buf3 = gcd(buf3, vec[i]);
        }
    }
    
    if (buf3 == 1) {
        cout << "setwise coprime" << endl;
        return 0;
    }
    
    cout << ans << endl;
    
    return 0;
}

int gcd(int x, int y) {
    if (x > y) {
        int buf = x;
        x = y;
        y = buf;
    }
    int r = 1;
    while(r != 0) {
        r = y % x;
        y = x;
        x = r;
    }
    return y;
}