#include <bits/stdc++.h>
#define ff first
#define ss second
#define int long long
#define all(x) (x).begin(), (x).end()
#define what_is(x) cerr << #x << " is " << x << endl;
#define eb emplace_back
#define pii pair<int, int>
#define inf 1e9

using namespace std;

const int mxn = 1e6 + 6;
vector<int> primes(mxn, 1), mpf(mxn);

void ini()
{
    primes[0] = primes[1] = 0;
    for (int i = 1; i < mxn; i++)
        mpf[i] = i;
    for (int i = 4; i < mxn; i += 2)
        primes[i] = 0, mpf[i] = 2;
    for (int i = 3; i < mxn; i += 2)
    {
        if (primes[i])
            for (int j = i * i; j < mxn; j += i)
                primes[j] = 0, mpf[j] = i;
    }
}

bool gcdarr(vector<int> v)
{
    int res = v[0];
    for (int i = 1; i < (int)v.size(); i++)
    {
        res = __gcd(res, v[i]);
    }
    return res == 1;
}

int n;
vector<int> v;
unordered_set<int> us;
map<int, int> pfc;
void solve()
{
    cin >> n;
    v.resize(n);
    bool pw = true, sw = true;
    int one = 0;
    for (int i = 0; i < n; i++)
        cin >> v[i], one += (v[i] == 1);
    if (one == n)
    {
        cout << "pairwise coprime";
        return;
    }
    for (int i = 0; i < n; i++)
    {
        if (v[i] != 1)
            us.insert(v[i]);
        if (v[i] != 1)
            pfc[v[i]]++;
        if (v[i] != 1 and !primes[v[i]])
        {
            int t = v[i];
            unordered_set<int> s;
            while (mpf[t] != t)
            {
                s.insert(mpf[t]);
                t /= mpf[t];
            }
            s.insert(mpf[t]);
            for (auto &j : s)
            {
                pfc[j]++;
                if (pfc[j] > 1)
                {
                    pw = false;
                    break;
                }
            }
        }
    }
    if ((int)us.size() != n - one)
    {
        pw = false;
    }
    if (pw)
    {
        cout << "pairwise coprime";
        return;
    }
    sw = gcdarr(v);
    if (sw)
    {
        cout << "setwise coprime";
        return;
    }
    cout << "not coprime";
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    // int t;
    // cin >> t;
    // while (t--)
    ini();
    solve();
    return 0;
}