#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <limits>
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define pint_INF 2000000000
#define ll_INF 	9223372036854775807
#define MOD 1000000007
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvll vector<vector<long long>>
#define vvc vector<vector<char>>
#define vll vector<long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define sysp system("PAUSE")
#define pno cout << "no" << endl
#define pyes cout << "yes" << endl
#define pYes cout << "Yes" << endl
#define pNo cout << "No" << endl
#define pNO cout << "NO" << endl
#define pYES cout << "YES" << endl
#define endl "\n"
#define pi 3.14159265358979
using namespace std;
using ll = long long;
#define int ll

template<typename T>
vector<T> smallest_prime_factors(T n) {

    vector<T> spf(n + 1);
    for (int i = 0; i <= n; i++) spf[i] = i;


    for (T i = 2; i * i <= n; i++) {

        // 素数だったら
        if (spf[i] == i) {

            for (T j = i * i; j <= n; j += i) {

                // iを持つ整数かつまだ素数が決まっていないなら
                if (spf[j] == j) {
                    spf[j] = i;
                }
            }
        }
    }

    return spf;
}

template<typename T>
map<T,T> factolization(T x, vector<T> & spf) {
    map<T,T> mp;
    while (x != 1) {
        mp[spf[x]]++;
        x /= spf[x];
    }
    return mp;
}


int gcd(int a, int b) {
    if (a > b) {
        int c = a;
        a = b;
        b = c;
    }
    if (a == 0) {
        return b;
    }

    return gcd(b % a, a);
}

int gcd_of_all(vi v) {
    int l = v.size();

    int temp = v[0];
    for (int i = 0; i < l; i++) {
        temp = gcd(temp, v[i]);
    }

    return temp;
}



signed main() {
    int MAX = 1e6 + 10;
    int N; cin >> N;
    auto spf = smallest_prime_factors(MAX);
    vector<int> A(N);
    vector<int> judge(MAX);
   

    int state = 3;
    for (int i = 0; i < N; i++) {
        int a; cin >> a;
        A[i] = a;
        map<int, int> mp = factolization(a, spf);
        
        for (auto iter = mp.begin(); iter != mp.end(); iter++) {
            int p = iter->first;
            int num = iter->second;

            if (judge[p] > 0) {
                state = 2;
                break;
            }
            else {
                judge[p] += num;
            }
        }
    }

    if (state == 3) {
        cout << "pairwise coprime" << endl;
    }
    else {
        if (gcd_of_all(A) == 1) {
            cout << "setwise coprime" << endl;
        }
        else {
            cout << "not coprime" << endl;
        }
    }

}

Measured memory_bytes: 34412