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

vector<ll> fac[1000005];

void build(){
    for(int i=2;i<=1000000;i++){
        if(fac[i].empty()){
            for(int j=i;j<=1000000;j+=i){
                fac[j].push_back(i);
            }
        }
    }
}

int main(){
    build();
    ll n;
    cin >> n;
    ll ar[n];
    for(int i=0;i<n;i++){
        cin >> ar[i];
    }
    ll gcdv=__gcd(ar[0],ar[1]);
    for(int i=2;i<n;i++){
        gcdv=__gcd(gcdv,ar[i]);
    }
    
    cout << gcdv << '\n';
    
    // for(int i=1;i<=100;i++){
    //     for(auto u:fac[i]){
    //         cout << u << " ";
    //     }
        
    //     cout << '\n';
    // }
    
    map<ll,ll> mfd;
    ll fl=0;
    for(int i=0;i<n;i++){
        for(auto u:fac[ar[i]]){
            if(mfd[u]==1){
                fl=1;
            }
            mfd[u]=1;
        }
    }
    
    if(fl==1 and gcdv!=1){
        cout << "not coprime";
    }
    
    else if(fl==0){
        cout << "pairwise coprime";
    }
    else if(gcdv==1){
        cout << "setwise coprime";
    }
    return 0;
}