// 　　＿＿
// 　／　<＠ﾌ
//  ｜(ﾉﾉハ))
//  ﾉ从ﾟヮﾟ从
// 　ﾉ｜ｿﾉГ|つ author:hotarunx
// 〈_ﾉ^^^ヽ|
// 　~~tｧtｧ~
#include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;

// https://qiita.com/drken/items/a14e9af0ca2d857dad23#4-%E7%B4%A0%E5%9B%A0%E6%95%B0%E5%88%86%E8%A7%A3
vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0;  // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1) res.push_back({N, 1});
    return res;
}

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());

    // answer flug
    bool pairwise_coprime = true;
    bool setwise_coprime = true;

    set<int> prime_factors_set;

    // pairwise coprime
    for (int i = 0; i < n; i++) {
        auto prime_factors = prime_factorize(a[i]);

        for (auto &&i : prime_factors) {
            if (prime_factors_set.count(i.first)) {
                pairwise_coprime = false;
            }
            prime_factors_set.insert(i.first);
        }
    }

    // setwise coprime
    int cumgcd = a[0];
    for (int i = 0; i < n; i++) {
        cumgcd = gcd(a[i], cumgcd);
    }
    setwise_coprime = cumgcd == 1;

    // answer
    if (pairwise_coprime)
        cout << "pairwise coprime" << endl;
    else if (setwise_coprime)
        cout << "setwise coprime" << endl;
    else
        cout << "not coprime" << endl;
}
