 //
#include<bits/stdc++.h>

using namespace std;

#define PB push_back
#define f first
#define s second
#define what_is(x) cerr << #x << " is " << x << endl;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const ll MOD = 1000000007;

const int N = 1000005;

void set_file_io(string in, string out)
{
    freopen((in+".in").c_str(), "r", stdin);
    freopen((out+".out").c_str(), "w", stdout);
}

void pairwise()
{
    cout << "pairwise coprime";
}

void setwise()
{
    cout << "setwise coprime";
}

void not_any()
{
    cout << "not coprime";
}

int spf[N];
bool seen[N];

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    //set_file_io("input", "output");
    spf[1] = 1;
    for(int i=2; i<N; i++)
    {
        spf[i] = i;
    }
    for(int i=4; i<N; i+=2)
    {
        spf[i] = 2;
    }
    for(int i=3; i*i<N; i++)
    {
        if(spf[i] == i)
        {
            for(int j=i*i; j<N; j+=i)
            {
                if(spf[j] == j)
                {
                    spf[j] = i;
                }
            }
        }
    }

    int n;
    cin >> n;
    int g = -1;
    bool pr = true;
    for(int i=0; i<n; i++)
    {
        int x;
        cin >> x;
        if(g == -1)
        {
            g = x;
        }
        else
        {
            g = __gcd(g, x);
        }
        while(x != 1)
        {
            if(seen[spf[x]])
            {
                pr = false;
            }
            seen[spf[x]] = true;
            while(x != 1 && x%spf[x] == 0)
                x /= spf[x];
        }
    }
    if(pr)
    {
        pairwise();
    }
    else if(g == 1)
    {
        setwise();
    }
    else
    {
        not_any();
    }
    return 0;
}
