#include<bits/stdc++.h>
using namespace std;
long long int  mod=1000000007;
bool coprime(int a, int b)
{
    return (__gcd(a, b) == 1);
}

// Recursive function to
// return gcd of a and b
int numOfPairs(vector<int> v)
{
    int n=v.size();
    int count = 0;
    for (int i = 0; i < n - 1; i++)
        for (int j = i + 1; j < n; j++)
            {if (coprime(v[i], v[j]))
                count++;
                else
                    return 0;
                }

    return count;
}

bool isSetwisePrime(vector<int> v)
{
    int result = v[0];
    for (int i = 1; i < v.size(); i++)
    {
        result = __gcd(v[i], result);

        if(result == 1)
        {
           return 1;
        }
    }
    if(result==1)
        return 1;
    else
        return 0;
}
int main()
{

 int n;
 cin>>n;



 vector<int> v(n);
 for(int i=0;i<n;i++)
 {
     cin>>v[i];
 }
 long long int f=(n)*(n-1)/2;
 if(numOfPairs(v)==f )
    cout<<"pairwise coprime"<<endl;
 else if(isSetwisePrime(v))
    cout<<"setwise coprime"<<endl;
 else
    cout<<"not coprime"<<endl;

 //cout<<(ans)<<endl;
return 0;
}