#include <bits/stdc++.h>
using namespace std;
#define int long long 
 
#define pi pair<int,int>
#define pb push_back
#define F first
#define S second
#define mod 1000000007
#define mx 1000000
#define mn 0
#define hello 123
  
#define MAXN   1000001 
  
// stores smallest prime factor for every number 
int spf[MAXN]; 
  
// Calculating SPF (Smallest Prime Factor) for every 
// number till MAXN. 
// Time Complexity : O(nloglogn) 
void sieve() 
{ 
    spf[1] = 1; 
    for (int i=2; i<MAXN; i++) 
  
        // marking smallest prime factor for every 
        // number to be itself. 
        spf[i] = i; 
  
    // separately marking spf for every even 
    // number as 2 
    for (int i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (int i=3; i*i<MAXN; i++) 
    { 
        // checking if i is prime 
        if (spf[i] == i) 
        { 
            // marking SPF for all numbers divisible by i 
            for (int j=i*i; j<MAXN; j+=i) 
  
                // marking spf[j] if it is not  
                // previously marked 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
} 
  
// A O(log n) function returning primefactorization 
// by dividing by smallest prime factor at every step 
set<int> s;
void getFactorization(int x) 
{ 
    while (x != 1) 
    { 
        s.insert(spf[x]); 
        x = x / spf[x]; 
    } 
    return ; 
} 


signed main()
{
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++)cin>>arr[i];
    sieve(); 
    int c=1;
    int gcd=1;
    int flag=0;
    getFactorization(arr[n-1]);
    if(n>1)
    gcd=__gcd(arr[0],arr[n-1]);
    for(int i=n-2;i>=0;i--)
    {
        flag=0;
        for(auto& z:s)if(arr[i]%z==0){flag=1;break;}
        if(flag==0)c++;
        getFactorization(arr[i]);
        gcd=__gcd(gcd,arr[i]);
    }
    if(c==n){cout<<"pairwise coprime";return 0;}
    
    if(gcd==1){cout<<"setwise coprime";return 0;}
    cout<<"not coprime";
}