/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#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 <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
//#include <unordered_set> //unordered_set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
#define endl "\n";
using namespace std;

const long long INF = 4000000000000000001;
const int inf = 1001001001;
const int MOD = 1000000007;
typedef pair<long long,long long> P;

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //When end-of-a-lin bit is 1, times simple N.
    if (M & 1) res = (res * N) % MOD;
    return res %= MOD;
}
long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a / gcd(a, b) * b ;
}



int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
 
    int N;cin >> N;
    vector<long long> retu(N);
    for(int i = 0;i<N;i++) cin >> retu.at(i);
    bool allOne = true;
    for(int i = 0;i<N;i++){
        if(retu.at(i) != 1){
            allOne = false;
        }
    }
    if(allOne){
        cout << "pairwise coprime" << endl;
        return 0;
    }
    long long GCD = 0;
    bool setwise_coprime = false;
    long long notOne = 0;
    for(int i = 0;i<N;i++){
        if(retu.at(i) != 1){
            notOne++;
        }
        else{
            GCD = 1;
            break;
        }
        if(GCD == 0){
            GCD = gcd(retu.at(i),retu.at(i+1));
            //cout << retu.at(i) << " " << retu.at(i+1) << " ";
            i++;
            continue;
        }
        else GCD = gcd(GCD,retu.at(i));
        //cout << retu.at(i) << endl;
    }
    if(GCD == 1){
        setwise_coprime = true;
    }
    else{
        cout << "not coprime" << endl;
        return 0;
    }
    //1000000以内に素数は78498個
    if(notOne > 78500){
        cout << "setwise coprime" << endl;
        return 0;
    }

    retu.erase(remove(retu.begin(),retu.end(),(long long)1),retu.end());
    N = retu.size();
    map<long long,int> prime_factor;
    for(int i = 0;i<N;i++){
        vector<bool> primeFactor(1000005);
        long long now = retu.at(i);
        while(true){
            long long prv = now;
            for(long long j = 2;j<=sqrt(now);j++){
                if(now % j == 0 && !primeFactor.at(j)){
                    primeFactor.at(j) = true;
                    prime_factor[j]++;
                    now /= j;
                    break;
                }
            }
            if(prv == now){
                if(!primeFactor.at(prv)) prime_factor[prv]++;
                break;
            }
        }
    }
    for(auto V : prime_factor){
        if(V.second > 1){
            cout << "setwise coprime" << endl;
            return 0;
        }
    }
    cout << "pairwise coprime" << endl;
}

Measured memory_bytes: 11120