#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define pii pair<pii , pii>
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAXX 1000005

int n , G;
int a[MAXX];

int main()
{
    _FastIO;
    vector<bool> used(MAXX , false);
    cin >> n;
    bool f = true;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        if(!i)
            G = a[0];
        else
            G = __gcd(G , a[i]);
        int s = 0;
        for(ll j = 2; j * j <= a[i]; j++){
            if((a[i] % j) == 0){
                if(used[j])
                    f = false;
                used[j] = true;
                int k = a[i] / j;
                if(used[k] && k != j)
                    f = false;
                used[k] = true;
                s++;
            }
        }
        if(a[i] != 1 && !s){
            if(used[a[i]])
                f = false;
            used[a[i]] = true;
        }
    }
    if(f){
        cout << "pairwise coprime" << endl;
        return 0;
    }
    if(G == 1){
        cout << "setwise coprime" << endl;
        return 0;
    }
    cout << "not coprime" << endl;
    return 0;
}
