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

const int MAXN = 1e6 + 5;
const int MOD = 1e9 + 7;

int n, a[MAXN], cnt[MAXN], gcdd;
vector<int> v[MAXN];

template <class T>
void read(T& x, T f = 1, char ch = getchar()) {
    x = 0;
    while (ch < '0' || ch > '9') f = (ch == '-' ? -1 : 1), ch = getchar();
    while (ch >= '0' && ch <= '9') x = x * 10 + ch - 48, ch = getchar();
    x *= f;
}

bool isprime(int x) {
    for (int i = 2; i <= sqrt(x); i++)
        if (x % i == 0) return false;
    return true;
}

void init() {
    for (int i = 2; i <= 1000; i++) {
        if (isprime(i)) {
            for (int k = 1; k * i <= 1000000; k++) v[k * i].push_back(i);
        }
    }
}

int main() {
    init();
    read(n);
    for (int i = 1; i <= n; i++) read(a[i]);
    gcdd = a[1];
    for (int i = 2; i <= n; i++) gcdd = __gcd(a[i], gcdd);
    bool tag = 1;
    for (int i = n; i >= 1; i--) {
        for (int j = 0; j < v[a[i]].size(); j++)
            if (cnt[v[a[i]][j]]) {
                tag = 0;
                break;
            }
        for (int j = 0; j < v[a[i]].size(); j++) cnt[v[a[i]][j]]++;
    }
    if (tag)
        cout << "pairwise coprime";
    else {
        if (gcdd == 1)
            cout << "setwise coprime";
        else
            cout << "not coprime";
    }
    return 0;
}
