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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define ALL(a) a.begin(),a.end()
#define INIT(a,b) memset(a,b,sizeof(a))
using lint = long long int;

bool is_setwise_coprime(const vector<int>& A) {
    int N = A.size();
    int g = A[0];
    for_(i,1,N) g = __gcd(g, A[i]);
    return g == 1;
}

bool is_pairwise_coprime(const vector<int>& A) {
    const int MXP = 1000006;
    vector<bool> is_prime(MXP, true);
    vector<int > prev_prime(MXP, -1);
    for_(i,2,MXP) {
        if (is_prime[i]) {
            for (int j=2*i; j<MXP; j+=i) {
                is_prime[j] = false;
                prev_prime[j] = i;
            }
        }
    }

    vector<int> count(MXP, 0);
    int N = A.size();
    for_(i,0,N) {
        int X = A[i];
        while (prev_prime[X] != -1) {
            int p = prev_prime[X];
            while (X % p == 0) X /= p;
            ++count[p];
        }
        ++count[X];
    }

    return (*max_element(ALL(count)) == 1);
}

int main() {
    int N;
    cin >> N;

    vector<int> A(N);
    for_(i,0,N) cin >> A[i];

    if (is_setwise_coprime(A)) {
        if (is_pairwise_coprime(A)) {
            puts("pairwise coprime");
        }
        else {
            puts("setwise coprime");
        }
    }
    else {
        puts("not coprime");
    }
}