#include <bits/stdc++.h>
using namespace std;

int used_prime[1'000'001];
bool is_prime[1'000'001];
vector<int> prime_list;

int gcd(int a, int b)
{
  if (b == 0) return (a);
  return gcd(b, a % b);
}

int main(void)
{
  is_prime[0] = false;
  is_prime[1] = false;
  for (int i = 2; i < 1'000'001; i++) is_prime[i] = true;
  for (int i = 2; i < 1'000'001; i++)
  {
    if (is_prime[i] == false) continue;
    prime_list.push_back(i);
    for (int j = 2; i * j < 1'000'001; j++) is_prime[i * j] = false;
  }
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int tmp = 0;
  for (int i = 0; i < n; i++) tmp = gcd(a[i], tmp);
  bool flag0 = false;
  if (tmp == 1) flag0 = true;
  bool flag = true;
  for (int i = 0; i < n; i++)
  {
    for (int j = 0; j < prime_list.size(); j++)
    {
      if (a[i] < prime_list[j]) break;
      if (a[i] % prime_list[j] == 0)
      {
        if (used_prime[j]) flag = false;
        used_prime[j] = true;
        while (a[i] > 0 && a[i] % prime_list[j] == 0) a[i] /= prime_list[j];
      }
    }
  }
  if (flag) cout << "pairwise coprime" << endl;
  else if (flag0) cout << "setwise coprime" << endl;
  else cout << "not coprime" << endl;
}