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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#define itrout(x) for(int i=0;i<x.size();i++) {cout << x[i] << (i==x.size()-1 ? "\n" : " ");}
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define debugbit(x, n) cerr << #x << " = " << bitset<n>(x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define itrdebug(x) cerr << #x << " "; for (auto & el : (x)) {cerr << (el) << " ";} cerr << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define debug(x)
#define debugbit(x, n)
#define itrdebug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

class Sieve {
    long long n_;
    vector<long long> sieve_, primes_;

public:
    explicit Sieve(long long n=1): n_(n), sieve_(n + 1) {
        sieve_[0] = sieve_[1] = -1;
        for (long long i = 2; i <= n; ++i) {
            if (sieve_[i]) continue;
            primes_.push_back(i);
            sieve_[i] = i;
            for (long long j = i*i; j <= n; j += i) {
                if (!sieve_[j]) sieve_[j] = i;
            }
        }
    }
    bool isPrime(long long x) {
        assert (n_ * n_ >= x);
        if (n_ >= x) {
            return sieve_[x] == x;
        } else {
            for (const auto prime : primes_) {
                if (x % prime == 0) return false;
            }
            return true;
        }
    }
    vector<long long> getPrimes() {
        return primes_;
    }
    vector<pair<long long, int>> getPrimeFactorList(long long x) {
        assert (n_ * n_ >= x);
        vector<long long> factorList;
        for (int i=(int)primes_.size()-1; i>=0; i--) {
            if (n_ >= x) break;
            while (x % primes_[i] == 0) {
                x /= primes_[i];
                factorList.emplace_back(primes_[i]);
            }
        }
        if (isPrime(x)) {
            factorList.emplace_back(x);
            x /= x;
        }
        assert (n_ >= x);
        while (x != 1) {
            factorList.push_back(sieve_[x]);
            x /= sieve_[x];
        }
        if (factorList.empty()) return {};
        vector<pair<long long, int>> res(1, pair<long long, int>(factorList[0], 0));
        for (long long p : factorList) {
            if (res.back().first == p) {
                res.back().second++;
            } else {
                res.emplace_back(p, 1);
            }
        }
        return res;
    }
};

void solve(long long N, std::vector<long long> A){
    Sieve sieve(1e6+1);
    unordered_set<int> pairwise, setwise;
    for (const auto& p : sieve.getPrimeFactorList(A[0])) {
        pairwise.insert(p.first);
        setwise.insert(p.first);
    }
    bool isPairwise = true;
    rep(i,1,N) {
        unordered_set<int> newSetwise;
        for (const auto& p : sieve.getPrimeFactorList(A[i])) {
            if (!pairwise.empty() && pairwise.find(p.first) != pairwise.end()) {
                isPairwise = false;
            } else if (isPairwise) {
                pairwise.insert(p.first);
            }
            if (!setwise.empty() && setwise.find(p.first) != setwise.end()) {
                newSetwise.insert(p.first);
            }
        }
        setwise = newSetwise;
    }
    if (isPairwise) {
        cout << "pairwise coprime" << endl;
    } else if (setwise.empty()) {
        cout << "setwise coprime" << endl;
    } else {
        cout << "not coprime" << endl;
    }
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 19944