# 1 "e.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "e.cpp"
# 1 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 1
       
# 11 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp"
# 1 "/home/tysm/dev/cpplib/bin/../stdlib/bits/stdc++.h" 1
 #include<bits/stdc++.h>
# 12 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 2
# 1 "/home/tysm/dev/cpplib/bin/../stdlib/ext/pb_ds/assoc_container.hpp" 1
 #include<ext/pb_ds/assoc_container.hpp>
# 13 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 2
# 1 "/home/tysm/dev/cpplib/bin/../stdlib/ext/pb_ds/tree_policy.hpp" 1
 #include<ext/pb_ds/tree_policy.hpp>
# 14 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 2
# 23 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp"
using namespace std;
using namespace __gnu_pbds;

using ii = pair<int64_t, int64_t>;
using tt = tuple<int64_t, int64_t, int64_t>;

using vi = vector<int64_t>;
using vd = vector<double>;
using vb = vector<bool>;
using vii = vector<ii>;
using vtt = vector<tt>;

using vvi = vector<vi>;
using vvd = vector<vd>;
using vvb = vector<vb>;
using vvii = vector<vii>;
using vvtt = vector<vtt>;
# 60 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp"
template<typename T>
ostream &operator<<(ostream &lhs, const vector<T> &rhs)
{
    if(is_floating_point<T>::value)
        lhs << fixed << setprecision(10);
    for(size_t i = 0; i < rhs.size(); ++i) {
        if(i)
            lhs << ' ';
        lhs << rhs[i];
    }
    return lhs;
}

template<typename T, size_t N>
ostream &operator<<(ostream &lhs, const array<T, N> &rhs)
{
    if(is_floating_point<T>::value)
        lhs << fixed << setprecision(10);
    for(size_t i = 0; i < rhs.size(); ++i) {
        if(i)
            lhs << ' ';
        lhs << rhs[i];
    }
    return lhs;
}
# 2 "e.cpp" 2
# 1 "/home/tysm/dev/cpplib/bin/../include/cpplib/math/euclid.hpp" 1
       


/**
 * Euclidean GCD.
 *
 * Computes the greatest commom divisor of
 * two integers.
 *
 * Time Complexity: O(log(min(a, b))).
 * Space Complexity: O(1).
 */
uint64_t gcd(uint64_t a, uint64_t b)
{
    for(; a != 0; a %= b)
        swap(a, b);
    return b;
}

/**
 * Extended Euclidean GCD.
 *
 * Besides computing the GCD it also returns
 * the roots of a*x + b*y = gcd(a, b).
 *
 * Time Complexity: O(log(min(a, b))).
 * Space Complexity: O(1).
 */
tuple<uint64_t, int64_t, int64_t> extended_gcd(uint64_t a, uint64_t b)
{
    int64_t x = 0, y = 1, x1 = 1, y1 = 0;
    while(a != 0) {
        uint64_t q = b / a;
        tie(x, x1) = make_tuple(x1, x - q * x1);
        tie(y, y1) = make_tuple(y1, y - q * y1);
        tie(a, b) = make_tuple(b % a, a);
    }
    return make_tuple(b, x, y);
}

/**
 * Euclidean Derivated LCM.
 *
 * Time Complexity: O(log(min(a, b))).
 * Space Complexity: O(1).
 */
uint64_t lcm(const uint64_t a, const uint64_t b)
{
    // same as a*b/gcd(a, b) but avoiding overflow.
    return a / gcd(a, b) * b;
}
# 3 "e.cpp" 2
# 1 "/home/tysm/dev/cpplib/bin/../include/cpplib/math/gries-misra.hpp" 1
       


/**
 * Sieve of Gries and Misra.
 *
 * Computes the prime numbers until
 * an upper bound and provides
 * number factorization.
 *
 * Time Complexity: O(n).
 * Space Complexity: O(n).
 * Where n is the sieve upper bound.
 */
class Sieve
{
public:
    Sieve(const uint64_t sieve_u) :
        sieve_u(sieve_u), spf(sieve_u + 1)
    {
        for(uint64_t i = 2; i <= sieve_u; ++i) {
            if(!spf[i]) {
                spf[i] = i;
                primes.emplace_back(i);
            }
            for(uint64_t p: primes) {
                if(p > spf[i] or i * p > sieve_u)
                    break;
                spf[i * p] = p;
            }
        }
    }

    /**
     * Computes the prime numbers in the range
     * [l, r].
     *
     * Time Complexity: O(n).
     * Space Complexity: O(n).
     * Where n is the size of the segment range (i.e. r - l + 1).
     */
    void segment(const uint64_t l, const uint64_t r)
    {
        assert(l <= r and ceil(sqrt(r)) <= sieve_u);
        tie(segment_l, segment_u) = make_tuple(l, r);

        uint64_t n = r - l + 1, lim = sqrt(r);
        segment_spf.assign(n, 0);
        segment_primes.clear();

        for(uint64_t p: primes) {
            if(p > lim)
                break;
            for(uint64_t i = (p * p >= l ? p * p - l : (p - l % p) % p); i < n; i += p) {
                if(!segment_spf[i])
                    segment_spf[i] = p;
            }
        }

        for(uint64_t i = l; i <= r; ++i) {
            if(i < 2 or segment_spf[i - l])
                continue;
            segment_spf[i - l] = i;
            segment_primes.emplace_back(i);
        }
    }

    /**
     * Computes the prime factorization of x.
     *
     * Note: it's not viable to factorize numbers
     * > sieve_u.
     *
     * Time Complexity: O(log(x)).
     * Space Complexity: O(log(x)).
     */
    vector<pair<uint64_t, uint64_t> > factorization(uint64_t x) const
    {
        assert(0 < x and x <= sieve_u);
        vector<pair<uint64_t, uint64_t> > factors;
        for(; x > 1; x /= spf[x]) {
            uint64_t p = spf[x];
            if(factors.empty() or factors.back().first != p)
                factors.emplace_back(p, 1);
            else
                factors.back().second++;
        }
        return factors;
    }

    /**
     * Checks if a number is prime.
     *
     * Note: x must be <= sieve_u or in the
     * segment range.
     *
     * Time Complexity: O(1).
     * Space Complexity: O(1).
     */
    bool is_prime(const uint64_t x) const
    {
        assert(x <= sieve_u or segment_l <= x and x <= segment_u);
        if(x <= sieve_u)
            return x <= 1 ? false : spf[x] == x;
        else
            return segment_spf[x - segment_l] == x;
    }

    /**
     * Returns the smallest prime factor of x.
     *
     * Note: x must be <= sieve_u or in the
     * precomputed segment range.
     *
     * Time Complexity: O(1).
     * Space Complexity: O(1).
     */
    uint64_t smallest_prime_factor(const uint64_t x) const
    {
        assert(1 < x and (x <= sieve_u or segment_l <= x and x <= segment_u));
        return x <= sieve_u ? spf[x] : segment_spf[x - segment_l];
    }

    /**
     * Returns the computed prime numbers <=
     * sieve_u.
     *
     * Time Complexity: O(n).
     * Space Complexity: O(n).
     * Where n is the sieve upper bound.
     */
    vector<uint64_t> prime_numbers() const
    {
        return primes;
    }

    /**
     * Returns the computed prime numbers in the
     * segment range.
     *
     * Time Complexity: O(n).
     * Space Complexity: O(n).
     * Where n is the size of the segment range (i.e. segment_u - segment_l + 1).
     */
    vector<uint64_t> segment_prime_numbers() const
    {
        return segment_primes;
    }

private:
    uint64_t sieve_u; // sieve upper bound.
    vector<uint64_t> spf, primes; // smallest prime factor and the primes <= sieve_u.
    uint64_t segment_l = 0, segment_u = 0; // segment upper and lower bounds.
    vector<uint64_t> segment_spf, segment_primes; // segment smallest prime factor and the primes in [segment_u, segment_lower].
};
# 4 "e.cpp" 2

int32_t main(){
    (ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL));
    int64_t n;
    cin >> n;

    vi arr(n);
    for(int64_t &i:arr)
        cin >> i;
    reverse(arr.begin(), arr.end());

    int64_t g = arr[0];
    for(int64_t i=1; i<n; ++i)
        g = gcd(arr[i], g);
    if(g > 1){
        cout << "not coprime" << "\n";
        return 0;
    }

    Sieve sv(1e6+1);
    set<int64_t> vis;
    bool ok = true;
    for(int64_t i=0; i<n and ok; ++i){
        for(auto [f, cnt] : sv.factorization(arr[i])){
            if(vis.count(f))
                ok = false;
            vis.emplace(f);
        }
    }
    cout << (ok? "pairwise coprime" : "setwise coprime") << "\n";
    return 0;
}


Measured memory_bytes: 19896