#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
#define forn(i,n) for(ll i=0;i < ll (n); i++)
vector<ll>prime_factors[1000007];
ll vis[1000007];

void prime_factor_generator(ll n)
{
    forn(i,n+1)
    {
        if(i<=1) continue;
        if(vis[i]==0)
        {
            for(ll j=i; j<=n; j+=i)
            {
                vis[j]=1;
                prime_factors[j].push_back(i);
            }
        }
    }
    return;
}

int main()
{
    ll n;
    prime_factor_generator(1000000);
    //cout<<endl;
    cin>>n;
    ll ans=-1;
    ll a[n];
    forn(i,n) cin>>a[i];
    ll tem=a[0];
    forn(i,n) tem=__gcd(tem, a[i]);
    if(tem==1) ans=1;
    else ans=3;
    if(ans==1)
    {
        map<ll, ll>mp;
        bool flag=1;
        forn(i,n)
        {
            forn(j,prime_factors[a[i]].size())
            {
                ll t=prime_factors[a[i]][j];
                mp[t]++;
                cout<<t<<" "<<mp[t]<<endl;
                if(mp[t]==2) {flag=0; break;}
            }
            if(flag==0) break;
        }
        if(flag) ans=2;
    }
    if(ans==1) cout<<"setwise coprime"<<endl;
    else if(ans==2) cout<<"pairwise coprime"<<endl;
    else cout<<"not coprime"<<endl;
    return 0;
}
