#include<bits/stdc++.h>
using namespace std;
int hcf (int n1, int n2)
{
  if (n2 != 0)
    return hcf (n2, n1 % n2);
  else
    return n1;
}

int main ()
{
  ios_base::sync_with_stdio (false);
  cin.tie (NULL);
  int mx = 78498;		//no.of primes less than 1e6;
  int maxn = 1e6 + 1;		//maximum size of array elements
  int sieve[maxn] = { 0 };
  int prime[mx];		//to store the primes
  int j = 0;
  for (int i = 2; i < maxn; i++)
    {
      if (sieve[i] == 0)
	{
	  prime[j++] = i;
	  for (int u = 2 * i; u < maxn; u += i)
	    sieve[u] = i;
	}
    }
  int freq[maxn] = { 0 };	//to store the frequencies of elements
  int n;
  cin >> n;
  int x[n];			//to store the array of elements
  int en = 1;			//counter to check if the set is pairwise coprime
  for (int i = 0; i < n; i++)
    {
      cin >> x[i];
      freq[x[i]] += 1;
      if (freq[x[i]] > 1)
	{
	  en = 0;
	  break;
	}
    }
  if (en == 1)
    for (int i = 0; i < mx; i++)
      {
	int temp = prime[i];
	int cnt = 0;
	for (int j = temp; j < maxn; j += temp)
	  {
	    if (freq[j] != 0)
	      cnt++;
	  }
	if (cnt > 1)
	  {
	    en = 0;
	    break;
	  }
      }
  if (en == 1)
    cout << "pairwise coprime";
  else
    {
      int gcd = hcf (x[0], x[1]);
      for (int i = 2; i < n; i++)
	  gcd = hcf (gcd, x[i]);
	  if (gcd == 1)
	cout << "setwise coprime";
      else
	cout << "not coprime";
    }
}