#include <bits/stdc++.h>
using namespace std;

const int MAX = 1000000;
//const int MAX = 10;
vector<int> D(MAX+1);

void pre(){

    for(int i=1;i<=MAX;i++)
        D[i] = i;

    vector<bool> is_prime(MAX+1,true);
    for(int i=2;i*i<=MAX;i++){
        if(!is_prime[i]) break;
        else{
            for(int j=i;j<=MAX;j*=2){
                if(is_prime[j]){
                    is_prime[j] = false;
                    D[j] = i;
                }
            }
        }
    }
}

/*int multi_gcd(int N,vector<int> A){
    if(N == 2)  return gcd(A[0],A[1]);
    else        return gcd(multi_gcd(N-1,A),A[N-1]);
}*/

int main(){

    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0;i<N;i++)
        cin >> A[i];

    pre();
    vector<bool> primes(MAX+1,false);
    bool is_pairwise = true;
    for(int i=0;i<N;i++){
        int a = A[i];
        int d = D[a];
        //bool loop_flag = false;
        while(d != a){
            if(!primes[d]){
                primes[d] = true;
                a /= d;
            }
            else{
                is_pairwise = false;
                break;
            }
        }
        if(!is_pairwise) break;
        primes[d] = true;
    }

    bool is_setwise = false;
    //if(multi_gcd(N,A) == 1) is_setwise = true;
    int tmp = A[N];
    while(N > 0){
        tmp = gcd(tmp,A[N-1]);
        if(tmp == 1){
            is_setwise = true;
            break;
        }
        else N--;
    }

    if(is_pairwise)
        cout << "pairwise coprime";
    else if(is_setwise)
        cout << "setwise coprime";
    else
        cout << "not coprime";

    return 0;
}