//Coprime 

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define nvarep(n,a) ll n;cin>>n;vector<ll>a(n);rep(i,0,n)cin>>a[i]
#define vecrep(n,a,type) vector<type>a(n);rep(i,0,n)cin>>a[i]
#define YN(flag) (flag?"Yes":"No")
#define lcm(a,b) (a/__gcd(a, b)*b)
#define range(a) (a).begin(),(a).end() 
#define pb push_back
#define mp make_pair
#define nnn "\n"
#define spa " "
using P = pair<ll,ll>;
using graph = vector<vector<ll>>;
const int inf = 2147483647;//2*10^9
const ll INF = 9223372036854775807;//9*10^18

unordered_set<int>a;

bool f(int n){
    for(int i=2;i*i<=n;i++){
        bool flag = false;
        while(n%i==0){
            flag = true;
            n/=i;
        }
        bool t = true;
        if(flag)t=a.insert(i).second;
        if(!t)return false;
    }
    return true;
}

signed main (){
    nvarep(n,a);
    int g=a[0];
    bool flag = true;
    rep(i,0,n){
        g=__gcd(a[i],g);
        if(flag)flag = f(a[i]);
    }
    if(flag)cout<<"pairwise coprime"<<nnn;
    else if(g==1)cout<<"setwise coprime"<<nnn;
    else cout<<"not coprime"<<nnn;
    return 0;
}