#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr int MAX = 1000005;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    
    vector<int> d(MAX, 0);
    for (int i = 2; i*i < MAX;) {
        while (d[i] != 0) i++;
        for (int j = i; j < MAX; j += i) {
            if (d[j] == 0)
                d[j] = i;
        }
    }
    vector<int> c(MAX, 0);
    bool flag = true;
    for (int i = 0; flag && i < n; i++) {
        int m = a[i];
        while (m > 1) {
            int p = d[m];
            c[p]++;
            if (c[p] > 1) {
                flag = false;
                break;;
            }
            while (m % p == 0) m /= p;
        }
    }
    if (flag) {
        cout << "pairwise coprime" << endl;
        return 0;
    }
    
    queue<int> q;
    for (int i = 0; i < n; i++)
        q.push(a[i]);
    while (q.size() >= 2) {
        int u = q.front();
        q.pop();
        int v = q.front();
        q.pop();
        q.push(gcd(u, v));
    }
    if (q.front() == 1)
        cout << "setwise coprime" << endl;
    else
        cout << "not coprime" << endl;

    return 0;
}
