#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<queue>
#include <cmath>
#include<algorithm>
#include<stack>
#include<map>
#include<ctime>
//#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

int main(){
    long int N;
    cin>>N;
    long int A[N];
    for (long int i=0;i<N;i++) cin>>A[i];
    sort(A,A+N);
    vector<long int> v,w(1005,1);
    for (long int i=2;i<1005;i++){
        if (w[i]==1){
            v.push_back(i);
            int n=i;
            while(n<1005){
                w[n]=0;
                n+=i;
            }
        }
    }
    long int sz=v.size();
    bool a=true,b=true;
    for (long int i=0;i<sz;i++){
        int m=0;
        for (long int j=0;j<N;j++){
            if (A[j]%v[i]==0){
              m++;
              while(A[j]%v[i]==0){
                A[j]=A[j]/v[i];
              }
        }
        if (m>=2) a=false;
        if (m==N) b=false;
    }

    if (a){
        for (long int i=0;i<N-1;i++){
            if (A[i]==A[i+1] && A[i]!=1) a=false;
        }
      if (A[0]==A[N-1] && A[0]!=1) b=false;
    }

    if (a) cout<<"pairwise coprime"<<endl;
    else if (b) cout<<"setwise coprime"<<endl;
    else cout<<"not coprime"<<endl;

    return 0;
}