#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

auto GCD(auto a, auto b) { //ユークリッドの互助法で最大公約数
    if(a % b == 0)return b;
    else return GCD(b, a % b);
}
auto LCM(auto a, auto b) { //GCDを使って最小公倍数を求める
    auto g = GCD(a, b);
    return (a / g) * b;
}


int main() {
    LL N;cin >> N;
    vector<LL> A(N);
    rep(i,N)cin >> A[i];

    vector<LL> rui(N);
    rui[N-1] = A[N-1];
    for(int i = N-1;i > 0;i--){
        rui[i-1] = GCD(rui[i],A[i-1]); 
    }

    bool pair = true;
    LL lc = 1;
    rep(i,N){
        lc *= A[i];
        lc %= MOD;
    }

    LL lc2 = 1;
    rep(i,N){
        lc2 = LCM(lc2,A[i]);
        lc2 %= MOD;
    }
    if(lc == lc2)pair = true;
    else pair = false;
    
    if(pair){
        cout << "pairwise coprime" << endl;
    }
    else{
        if(rui[0] == 1)cout << "setwise coprime" << endl;
        else cout << "not coprime" << endl;
    }
    
}