
// Problem : E - Coprime
// Contest : AtCoder - AtCoder Beginner Contest 177
// URL : https://atcoder.jp/contests/abc177/tasks/abc177_e
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
typedef long long       ll;
#define PI                acos(-1)
#define pb                push_back
#define mp                make_pair
#define mt                make_tuple
#define all(a)            (a).begin(), (a).end()
#define clr(a,h)          memset(a, (h), sizeof(a))
#define F first
#define S second
#define fore(i,b,e)		  for(int i=(int)b;i<(int)e;++i)
#define forr(i,b,e)		  for(int i=(int)b;i<(int)e;++i)
#define deb(x)			  cerr << "# " << (#x) << " = " << (x) << endl;
#define sz(x)             (int)x.size()
int faster_in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -faster_in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

using namespace std;

typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
const int INF = 1234567890;

const int tam = 1e6+10;

bool esPrimo[tam], isPC[tam];
int a[tam], sum[tam];
vi primos[tam];

void criba() {
	fore(i, 2, tam) esPrimo[i] = true;
	fore(i, 2, tam) {
		if (!esPrimo[i]) continue;
		primos[i].pb(i);
		for (int j = i+i; j < tam; j += i) {
			esPrimo[i] = false;
			primos[j].pb(i);
		}
	}
}

int main()
{
    std::ios::sync_with_stdio(false); cin.tie(0);
    //freopen("","r",stdin);
    //freopen("","w",stdout);
    criba();
    int n;
    cin >> n;
    fore(i, 0, n) cin >> a[i];
    //int GCD = a[0];
    //fore(i, 1, n) GCD = __gcd(GCD, a[i]);
    int ite = 1;
    fore(i, 0, n) {
    	bool pc = true;
    	for (int p : primos[a[i]]) {
    		if (sum[p] == ite) pc = false;
    		sum[p] = ite;
    	}
    	isPC[i] |= pc;
    }
	ite++;
    for (int i = n-1; i >= 0; i--) {
		bool pc = true;
    	for (int p : primos[a[i]]) {
    		if (sum[p] == ite) pc = false;
    		sum[p] = ite;
    	}
    	isPC[i] |= pc;
    }
    bool allPC = true;
    fore(i, 0, n) {
    	allPC &= isPC[i];
    }
    if (allPC) {
    	cout << "pairwise coprime" << '\n';
    	return 0;
    }
	int GCD = a[0];
    fore(i, 1, n) GCD = __gcd(GCD, a[i]);
    if (GCD == 1) {
    	cout << "setwise coprime" << '\n';
    	return 0;
    }
    cout << "not coprime" << '\n';
    return 0;
}
// Dinosaurs are cool!