// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
//#include <bits/stdc++.h>

#define all(v) v.begin(), v.end()
typedef long long ll;
#define rep(i, z, n) for(int i = z; i < n; i++)
//const int INF = 1<<29;
const ll MOD = 1000000007;
#define P pair<int, int>
using namespace std;

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>
vector<T> factolization(T x, vector<T> &spf) {
    vector<T> ret;
    while (x != 1) {
        ret.push_back(spf[x]);
        x /= spf[x];
    }
    sort(ret.begin(), ret.end());
    return ret;
}

int Euclidean(int a, int b){
    // b = a * q + r
    if(a > b) swap(a, b);
    int r = b % a;
    if (r == 0) return a;
    else return Euclidean(a, r);
}

int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, 0, N) cin >> A.at(i);
    sort(all(A));
    
    constexpr int MAX = 1000000;

    auto spf = smallest_prime_factors(MAX);
    
    map<int, int> mp;
    bool pa = true, se = false;

    rep(i, 0, N){
        auto result = factolization(A.at(i), spf);
        map<int, int> mp_in;
        for (auto z: result){
            //cout << z << " ";
            if(mp.count(z)){
                mp[z]++;
                mp_in[z]++;
                //cout << "z " << z << " mp " << mp[z] << " mp_in " << mp_in[z] << endl;
                if(mp[z] == mp_in[z]){
                    continue;
                }
                else{
                    pa = false;
                }
            }
            else{
                mp[z] = 1;
                mp_in[z] = 1;
            }
        }
        //cout << endl;
    }
    
    int x = A.at(0);
    rep(i, 1, N){
        x = Euclidean(x, A.at(i));
        if(x == 1){
            se = true;
            break;
        }
    }

    if(pa){
        cout << "pairwise coprime" << endl;
    }
    else{
        if(se){
            cout << "setwise coprime" << endl;
        }
        else{
            cout << "not coprime" << endl;
        }
    }
}

Measured memory_bytes: 14692