///====================== TEMPLATE STARTS HERE =====================///
#include <bits/stdc++.h>
using namespace std;

#define endl "\n"
#define pb push_back
#define MP make_pair
#define ff first
#define ss second
#define ABS(x) ((x)<0?-(x):(x))
#define FABS(x) ((x)+eps<0?-(x):(x))
#define LCM(x,y) (((x)/gcd((x),(y)))*(y))
#define POPCOUNT __builtin_popcountll
#define Set(N,p) ((N)|((1LL)<<(p)))
#define Reset(N,p) ((N)&(~((1LL)<<(p))))
#define Check(N,p) (!(((N)&((1LL)<<(p)))==(0)))
#define fast_cin ios_base::sync_with_stdio(false);cin.tie(NULL)

#define LL long long
#define LLU long long unsigned int
typedef pair < int, int > pii;
typedef pair < LL, LL > pll;
typedef vector<int> vi;
typedef vector<LL> vl;
typedef vector<pll> vll;

#ifdef s_da_sailor
    #define line                    cout << "\n===================\n"
    #define trace(...)              __f( #__VA_ARGS__ , __VA_ARGS__ )
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " = " << arg1 << "\n";
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ',');
        cerr.write(names, comma - names) << " = " << arg1 << " , ";
    __f(comma + 1, args...);
    }
#else
    #define line
    #define trace(...)
#endif // s_da_sailor

inline LL gcd ( LL a, LL b ) {
    a = ABS ( a ); b = ABS ( b );
    while ( b ) { a = a % b; swap ( a, b ); } return a;
}

LL ext_gcd ( LL A, LL B, LL *X, LL *Y ){
    LL x2, y2, x1, y1, x, y, r2, r1, q, r;
    x2 = 1; y2 = 0;
    x1 = 0; y1 = 1;
    for (r2 = A, r1 = B; r1 != 0; r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y ) {
        q = r2 / r1;
        r = r2 % r1;
        x = x2 - (q * x1);
        y = y2 - (q * y1);
    }
    *X = x2; *Y = y2;
    return r2;
}

inline LL modInv ( LL a, LL m ) {
    LL x, y;
    ext_gcd( a, m, &x, &y );
    x %= m;
    if ( x < 0 ) x += m;
    return x;
}

inline LL bigmod ( LL a, LL p, LL m ) {
    LL res = 1 % m, x = a % m;
    while ( p ) {
        if ( p & 1 ) res = ( res * x ) % m;
        x = ( x * x ) % m; p >>= 1; /// For bigmod2 multiply here using mulmod
    }
    return res;
}


//int knightDir[8][2] = { {-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1} };
//int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
//int dir8[8][2] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}};
const LL inf = 2147383647;
const LL mod = 1000000007;
const double pi = 2 * acos ( 0.0 );
const double eps = 1e-11;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); /// For generating random numbers

///======================  TEMPLATE ENDS HERE  =====================///

#define SIZE 1000005

vector<LL> Prime; //Prime vector

LL mark[SIZE]; //1 if not prime, 0 if prime

void sieve(LL n) {
    LL i, j, limit = sqrt(n*1.0) + 2;

    mark[1] = 1; //1 is not prime

    for(i=4; i<=n; i+=2) mark[i] = 1; //evens

    Prime.push_back(2); //2 is prime

    for(i=3; i<=n; i+=2) { //run loops only on odds
        if(!mark[i]) {
            Prime.push_back(i);

            //if we don't do it, following
            //i*i may overflow
            if(i<=limit) {
                for(j=i*i; j<=n; j += i*2) {
                    mark[j] = 1;
                }
            }
        }
    }
}

LL n, A[SIZE], isDiv[SIZE];

void solve() {
    cin >> n;
    for(LL i=0; i<n; i++) {
        cin >> A[i];
    }

    for(LL i=0; i<n; i++) {
        LL curr = A[i];
        LL lim = sqrt(curr*1.0 + eps);

        if(curr==1) continue;
        if(curr==2) {
            isDiv[2]++;
            continue;
        }
        if(curr==3) {
            isDiv[3]++;
            continue;
        }
        if(curr==4) {
            isDiv[2]++;
            continue;
        }
        if(curr==5) {
            isDiv[5]++;
            continue;
        }
        if(curr==6) {
            isDiv[2]++;
            isDiv[3]++;
            continue;
        }
        if(curr<=1000000 && !mark[curr]) {
            isDiv[curr]++;
            continue;
        }

        for(LL j=0; j<(LL)Prime.size(); j++) {
            if(Prime[j]>lim) break;
            if(curr%Prime[j]==0) {
                isDiv[Prime[j]]++;
                if(curr/Prime[j]!=Prime[j]) {
                    isDiv[curr/Prime[j]]++;
                }
            }
        }
    }

    LL flag = 1;
    for(LL i=2; i<=1000000; i++) {
        if(isDiv[i]>1) {
            flag = 0;
            break;
        }
    }

    if(flag) {
        cout << "pairwise coprime\n";
        return;
    }

    LL GG = 0;
    for(LL i=0; i<n; i++) {
        GG = gcd(GG, A[i]);
    }

    if(GG==1) {
        cout << "setwise coprime\n";
    }
    else {
        cout << "not coprime\n";
    }
}

int main () {
    #ifdef s_da_sailor
    freopen ( "input.txt", "r", stdin );
    //freopen ( "output.txt", "w", stdout );
    #endif // s_da_sailor

    fast_cin;

    sieve(1000000);

    solve();

    return 0;
}


Measured memory_bytes: 27124