#include <bits/stdc++.h>
#include <climits>

using namespace std;

template<class T>
using V = vector<T>;
template<class T>
using VV = V<V<T>>;

using ld = long double;
#define ll long long
using ull = unsigned ll;
using PLL = pair<ll, ll>;
using VLL = V<ll>;
using VB = V<bool>;
using VVB = VV<bool>;
using VVLL = VV<ll>;
using Gr = VVLL;
using MLL = map<ll, ll>;
#define UMLL unordered_map<ll, ll, custom_hash>
//typedef __int128 int128;
//typedef __float128 double128;

#define fast ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr);

#define INF LLONG_MAX
#define MINF LLONG_MIN

#define R &
#define CR const R

#define FORI(i, a, b) for(ll i = a, max##i = b; i < max##i; ++i)
#define FOR(i, n) FORI(i, 0, n)
#define RFORI(i, a, b) for(ll i = a, min##i = b; i >= min##i; --i)
#define RFOR(i, n) RFORI(i, n, 0)
#define FORA(i, a) for(auto i : a)
#define FORAR(i, a) for(auto R i : a)
#define FORACR(i, a) for(auto CR i : a)
#define ALL(obj) begin(obj), end(obj)
#define Count(q) while(q--)
#define OK cerr << "OK\n";

#define mp make_pair
#define pb push_back

//#define DEBUG

template<class T>
T sqr(T x)
{
    return x * x;
}

void YES(bool g, ostream R os, bool upper = false)
{
    if(g)
        if(upper)
            os << "YES";
        else
            os << "Yes";
    else
        if(upper)
            os << "NO";
        else
            os << "No";

    os << "\n";
}

template<class T>
ll cast(T CR t)
{
    return static_cast<ll>(t);
}

template<class T>
void show(T CR t, ostream R os = cerr)
{
    FORACR(i, t)
        os << i << " ";
    os << "\n";
}

constexpr ll MOD = 1e9 + 7;
//constexpr ll len = 78498 + 300;
//constexpr ld eps = 1e-9;

//constexpr ld unreal = -1e9;

constexpr ld PI = atanl(1.0L) * 4;

struct custom_hash
{
    static uint64_t splitmix64(uint64_t x)
    {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator() (uint64_t x) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

VLL sieve(ll n) //[1, n]
{
    VLL p(n + 1, 1);
    for(ll i = 2; i * i <= n; ++i)
        if(p[i])
            for(ll j = 2 * i; j <= n; j += i)
                p[j] = 0;

    VLL res;
    for(ll i = 2; i <= n; ++i)
        if(p[i])
            res.pb(i);

    return res;
}

void solve(istream R is, ostream R os)
{
    ll n;
    is >> n;

    VLL p = sieve(1e6);
    //cerr << p.size() << "\n";

    UMLL ind;
    FOR(i, p.size())
        ind[p[i]] = i;

    VLL a(n);
    FORAR(i, a)
        is >> i;

    ll one = 0;
    FORACR(i, a)
        one += i == 1;

    auto parse = [&p, &ind](ll x)
    {
        bitset<170> m(0);
        for(ll i = 0; i < p.size() && p[i] * p[i] <= x; ++i)
            if(x % p[i] == 0)
            {
                m[i] = 1;
                while(x % p[i] == 0)
                    x /= p[i];
            }

        ll i = -1;
        if(x != 1)
            i = ind[x];

        return pair<bitset<170>, ll>(m, i);
    };

    if(n - one <= p.size())
    {
        bitset<78500> m(0);
        bool g = true;

        FORACR(i, a)
        {
            if(i == 1)
                continue;

            auto now = parse(i);
            auto bm = now.first;
            auto bit = now.second;

            FOR(j, 170)
                if(bm[j] && m[j])
                    g = false;

            FOR(j, 170)
                m[j] = m[j] || bm[j];

            if(bit != -1)
            {
                if(m[bit])
                    g = false;

                m[bit] = 1;
            }
        }

        if(g)
        {
            os << "pairwise coprime\n";
            return;
        }
    }

    ll g = a[0];
    FORACR(i, a)
        g = __gcd(i, g);

    if(g == 1 || one)
    {
        os << "setwise coprime\n";
        return;
    }

    os << "not coprime\n";
}

int main()
{
    fast
    ll q = 1;
    //cin >> q;
    cout << setprecision(999);
    Count(q)
        solve(cin, cout);
}


Measured memory_bytes: 16248