#include <bits/stdc++.h>
using namespace std;
int main(){
    int N,i;
    cin >> N;
    int A[N],gcd[N + 1];
    for(i = 0;i < N;i++){
        cin >> A[i];
    }
    gcd[N + 1] = 1;
    for (i = N - 1; i >= 0; i--){
        gcd[i] = __gcd(gcd[i + 1],A[i]);
    }
    for(i = 0;i < N - 1;i++){
        if(gcd[N - 1] == 1){
            cout << "pairwise coprime ";
        }
        else if(gcd[N - i] == 1){
            cout << "setwise coprime ";
        }
        else{
            cout << "not coprime ";
        }
    }
    i = N - 1;
    if (gcd[N - 1] == 1)
    {
        cout << "pairwise coprime" << endl;
    }
    else if (gcd[N - i] == 1)
    {
        cout << "setwise coprime" << endl;
    }
    else
    {
        cout << "not coprime" << endl;
    }
    cout << gcd[0] << endl;
}