#include <iostream>
#include <vector>
#include <numeric>
#include <unordered_set>

using namespace std;

int main(void) {
    int n;
    cin >> n;
    vector<int> A(n);
    int ma = 0;
    bool has_one = false;
    for (int &a : A) {
        cin >> a;
        ma = max(ma, a);
        has_one = has_one || a == 1;
    }

    if (has_one) {
        cout << "not coprime" << endl;
        return 0;
    }


    vector<int> pf(ma + 1);
    iota(pf.begin(), pf.end(), 0);
    for (int i = 2; i * i <= ma; i++) {
        if (pf[i] == i) {
            for (int j = i * i; j <= ma; j += i) {
                pf[j] = i;
            }
        }
    }
    
    int r = 0;
    bool pairwise_coprime = true;
    unordered_set<int> factors;
    for (int i = 0; i < n; i++) {
        // handle setwise
        r = gcd(r, A[i]);

        // handle pairwise
        int a = A[i];
        while (a > 1) {
            if (factors.find(pf[a]) == factors.end())
            {
                factors.insert(pf[a]);
                a /= pf[a];
            }
            else
            {
                i = n;
                a = 1;
                pairwise_coprime = false;
            }
        }  
    }

    if (pairwise_coprime)
    {
        cout << "pairwise coprime" << endl;
    }
    else if (r == 1)
    {
        cout << "setwise coprime" << endl;
    }
    else
    {
        cout << "not coprime" << endl;
    }

    return 0;
}

