#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,i;
    cin>>n;
    vector<long long int> a(n);
    for(auto& x: a)
        cin>>x;

    long long int gcd=__gcd(a[0],a[1]);
    long long int pdt=a[0]*a[1];
    for(i=2;i<n;i++)
    {
        gcd=__gcd(gcd,a[i]);
        pdt*=a[i];
    }
    //cout<<"all gcd: "<<gcd<<endl;
    if(gcd!=1)
        cout<<"not coprime\n";
    else
    {
        long long int lcm = (a[n-1]*a[n-2])/__gcd(a[n-1],a[n-2]);
        //cout<<"last two elem lcm: "<<lcm<<endl;
        for(i=n-3;i>=0;i--)
            lcm=(a[i]*lcm)/__gcd(a[i],lcm);
        //cout<<"all lcm: "<<lcm<<endl;
        if(pdt==lcm)
            cout<<"pairwise coprime\n";
        else
            cout<<"setwise coprime\n";
    }
    return 0;
}
