#include <map>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <math.h>
#include <iostream>
#include <queue>
#include <set>

#define ll long long
#define sf(a) scanf("%lld",&a)
#define pf(b) printf("%lld",b)
#define sp printf(" ")
#define nw printf("\n")
#define mp make_pair
#define pi pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define sor(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define fast ios_base::sync_with_stdio(false)
using namespace std;

vector<ll>prime;
void sieve()
{
    int sroot=1009;
    bool a[sroot];
    memset(a, 0, sizeof(a));

  for(int i = 2; i <= sroot; i++) {
    if(a[i] == 0) {
      for (int j = i + i; j <= sroot; j = j + i) {
        a[j] = 1;
      }

    }

  }

  for (int i = 2; i <= sroot; i++) {
    if(a[i] == 0) {
      prime.push_back(i);
    }

  }
}
ll mark[10000];
int main()
{

  sieve();
  ll n,sprime,pprime,gc;
  sprime=pprime=1;
  sf(n);
  ll ar[n+1];
  for(ll i=1;i<=n;i++)
  {
     sf(ar[i]);
     if(i>1)
     gc=__gcd(gc,ar[i]);
     else gc=ar[i];
     ll val=ar[i];
     for(ll j=0;prime[j]*prime[j]<=val and j<prime.size();j++)
     {
      while(val%prime[j]==0){
          mark[prime[j]]++;
          val/=prime[j];
      }
     }
     if(val>1) mark[val]++;
  }
  if(gc!=1) sprime=0;
  for(ll i=1;i<=1;i++)
  {
     ll val=ar[i];
     for(ll j=0;prime[j]*prime[j]<=val and j<prime.size();j++)
     {
      while(val%prime[j]==0){
          mark[prime[j]]--;
          val/=prime[j];
      }
     }
     if(val>1) mark[val]--;
     val=ar[i];
     for(ll j=0;prime[j]*prime[j]<=val and j<prime.size();j++)
     {
      while(val%prime[j]==0){
          if(mark[prime[j]])
          {
            pprime=0;
            break;
          }
          val/=prime[j];
      }
      if(!pprime) break;
     }
     if(val>1)  if(mark[val]) pprime=0;
     if(!pprime) break;
  }
  if(pprime) printf("pairwise coprime");
  else if(sprime) printf("setwise coprime");
  else printf("not coprime");
}