#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <functional>
#include <cstring>
#include <regex>
#include <random>
#include <cassert>
#include <stack>
#include <climits>
#include <chrono>
#include <fstream>
using namespace std;

#pragma region

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, s, n) for (int i = (s); i < (int)(n); i++)
#define revrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define revrepr(i, s, n) for (int i = (n) - 1; i >= s; i--)
#define debug(x) cerr << #x << ": " << x << "\n"
#define popcnt(x) __builtin_popcount(x)

const double PI = acos(-1.0);

using ll = long long;
using P = pair<int, int>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<class T>
istream& operator >>(istream &is, vector<T> &v) {
    for (int i = 0; i < (int)v.size(); i++) cin >> v.at(i);
    return is;
}

template<class T, class U>
ostream& operator <<(ostream &os, pair<T, U> p) {
    cout << '(' << p.first << ", " << p.second << ')';
    return os;
}

template<class T>
void print(const vector<T> &v, const string &delimiter = " ") { rep(i, v.size()) cout << (0 < i ? delimiter : "") << v.at(i); cout << endl; }

template<class T>
void print(const vector<vector<T>> &vv, const string &delimiter) { for (const auto &v: vv) print(v, delimiter); }

#pragma endregion


const int MAX_V = 1000001;
int divide[MAX_V + 1];
vector<int> sieve() {
    for (int i = 0; i < MAX_V + 1; i++) divide[i] = 1;
    vector<int> is_prime(MAX_V + 1, true);
    for (int i = 2; i <= MAX_V; i++) {
        if (!is_prime.at(i)) continue;

        is_prime.at(i) = true;
        divide[i] = i;
        for (int j = i + i; j <= MAX_V; j += i) {
            is_prime.at(j) = false;
            divide[j] = i;
        }
    }
    vector<int> res;
    for (int i = 2; i <= MAX_V; i++) if (is_prime.at(i)) res.push_back(i);
    return res;
}

map<int, int> prime_factor(int n) {
    map<int, int> res;
    while (1 < n) {
        res[divide[n]]++;
        n /= divide[n];
    }
    return res;
}

vector<int> sieve(int n) {
    vector<int> is_prime(n + 1, true);
    for (int i = 2; i <= n; i++) {
        if (!is_prime.at(i)) continue;

        is_prime.at(i) = true;
        for (int j = i + i; j <= n; j += i) is_prime.at(j) = false;
    }
    vector<int> res;
    for (int i = 2; i <= n; i++) if (is_prime.at(i)) res.push_back(i);
    return res;
}

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    cin >> a;

    sieve();

    bool is_pc = true;
    vector<int> max_e(MAX_V);
    vector<int> cnt_e(MAX_V);
    rep(i, n) {
        auto ps = prime_factor(a[i]);
        bool all_su = true;
        for (auto [p, e]: ps) {
            cnt_e[p]++;
            //cout << a[i] << " " << p << endl;
            if (e <= max_e[p]) {
                all_su = false;
                //break;
            }
            chmax(max_e[p], e);
        }

        if (!all_su) {
            is_pc = false;
            //break;
        }
    }

    if (is_pc) {
        cout << "pairwise coprime" << endl;
        return 0;
    }
    
    bool is_sc = true;
    auto ps = sieve(MAX_V);
    for (int p: ps) {
        //cout << "prime" << p << endl;
        if (cnt_e[p] == n) {
            is_sc = false;
            //cout << p << endl;
            //cout << cnt_e[p] << endl;
            break;
        }
    }
    if (is_sc) cout << "setwise coprime" << endl;
    else cout << "not coprime" << endl;
}

Measured memory_bytes: 23752