#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <array>
#include <bitset>
#define rep(i,r) for(int i = 0; i < (r); i++)
#define pb push_back
#define all(a) a.begin(), a.end()
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long
#define uint unsigned long long
#define endl '\n'
using namespace std;

const int mn = 1e6 + 10;
int n;
int a[mn];

int gcd(int a, int b) {
    return a % b ? gcd(b , a % b) : b;
}

signed main() {
    fastio;
    cin >> n;
    rep (i, n) {
        cin >> a[i];
    }

    set<int> st, temp; // set of all factors
    int g = a[0];
    temp = f(g);
    for (auto t : temp) {
        st.insert(t);
    }

    bool pairwise = true;
    for (int i = 1; i < n; i++) {
        temp.clear();
        int ai = a[i];
        // check for setwise coprime
        g = gcd(g, ai);

        // factorize ai
        for (int i = 2; i * i <= ai; i++) {
            if (ai % i == 0) {
                temp.insert(i);
                while (ai % i == 0) 
                    ai /= i; 
            }
        }


        // check for pairwise coprime and update cache
        for (auto& t : temp) {
            if (st.count(t)) {
                pairwise = false;
            }
            st.insert(t);
        }

        // update cache of all prime factors seen so far
        // cerr << "gcd: " << g << endl;
    }

    if (pairwise) {
        cout << "pairwise coprime" << endl;
    }
    else if (g == 1) {
        cout << "setwise coprime" << endl;
    }
    else {
        cout << "not coprime" << endl;
    }
}