#include<bits/stdc++.h>
#define rep(i,n) for ( int i=0; i< (n); ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int gcd( int m, int n ){ // m/n
    if( n==0 ) return m;
    return gcd( n, m%n);
}

P coprime( int s, int g, vector<int> &A ){
    if( g-s < 2 ){
        return {A[s],0};
    }
    int piv = (g+s)/2;
    P p1 = coprime(s,piv,A);
    P p2 = coprime(piv,g,A);
    int r = gcd( p1.first, p2.first );
    int cprm = 0;
    if( r != 1 or p1.second + p2.second != 0 ) cprm = 1;
    return {r,cprm};
}

int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i,N) cin >> A[i];
    P p = comprime( 0, N, A );
    int r = p.first;
    int cprm = p.second;
    if( r == 1 ){
        if( cprm == 0 ) cout << "pairwise coprime" << endl;
        else cout << "serwise coprime" << endl;
    }
    else  cout << "not coprime" << endl;
    return 0;
}
