#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < int(n); ++i)

int a_max;

vector<bool> f(1e6 + 1, true);

void sieve(void)
{
    f[0] = false, f[1] = false;
    for (int i = 2; i <= a_max; ++i)
    {
        if (f[i])
            for (int j = 2 * i; j <= a_max; j += i)
                f[j] = false;
    }
}

map<int, int> prime_factory(int x)
{
    map<int, int> res;
    if (f[x])
    {
        res[x] = 1;
        return res;
    }

    set<int> st;
    vector<int> tmp;
    for (int i = 2; i * i <= x; ++i)
    {
        if (x % i == 0)
        {
            st.insert(i);
            if (x % (x / i) == 0)
                st.insert(x / i);
        }
    }
    for (auto i : st)
    {
        if (f[i])
        {
            while (x % i == 0)
            {
                tmp.push_back(i);
                x /= i;
            }
        }
    }

    for (auto i : tmp)
        res[i]++;
    return res;
}

void solve(void)
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    a_max = *max_element(a.begin(), a.end());
    sieve();
    map<int, int> mp;
    rep(i, n)
    {
        for (auto i : prime_factory(a[i]))
            mp[i.first] += 1;
    }
    bool flag = true;
    for (auto i : mp)
    {
        if (i.second > 1)
            flag = false;
    }
    if (flag)
        cout << "pairwise coprime" << endl;
    else
    {
        int x = a[0];
        rep(i, n - 1) x = __gcd(x, a[i + 1]);
        if (x == 1)
            cout << "setwise coprime" << endl;
        else
            cout << "not coprime" << endl;
    }
}
int main(void)
{
    solve();
}