#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define ld  long double
#define endl '\n'
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll MOD = (ll)1e9+7;
const double PI = 3.141592653589793238463;
const int MAXN = 200005;
bool findFactor(int value, 
                unordered_set<int>& factors) 
{ 
    factors.insert(value); 
    for (int i = 2; i * i <= value; i++) { 
        if (value % i == 0) { 
            if (value / i == i) { 
                if (factors.find(i) 
                    != factors.end()) { 
                    return true; 
                } 
                else { 
                    factors.insert(i); 
                } 
            } 
            else { 
                if (factors.find(i) != factors.end() 
                    || factors.find(value / i) 
                           != factors.end()) { 
                    return true; 
                } 
                else { 
                      factors.insert(i); 
                    factors.insert(value / i); 
                } 
            } 
        } 
    } 
    return false; 
} 
  
bool allCoprime(int A[], int n) 
{ 
    bool all_coprime = true; 
    unordered_set<int> factors; 
    for (int i = 0; i < n; i++) { 
        if (A[i] == 1) 
            continue; 
        if (findFactor(A[i], factors)) { 
            all_coprime = false; 
            break; 
        } 
    } 
    return all_coprime; 
} 

int main() {
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    if(allCoprime(arr,n)){
        cout<<"pairwise coprime"<<endl;
    }
    else{
        int gcd=0;
        for(int i=0;i<n;i++){
            gcd=__gcd(gcd,arr[i]);
        }
        if(gcd==1){
            cout<<"setwise coprime"<<endl;
        }
        else{
            cout<<"not coprime"<<endl;
        }
    }
    return 0;
}