#include <iostream>
#include <numeric>
#include <vector>
using namespace std;

std::vector<bool> is_prime(1000001);

std::vector<int> Eratosthenes( const int N )
{
    for( int i = 0; i <= N; i++ )
    {
        is_prime[ i ] = true;
    }
    std::vector<int> P;
    for( int i = 2; i <= N; i++ )
    {
        if( is_prime[ i ] )
        {
            for( int j = 2 * i; j <= N; j += i )
            {
                is_prime[ j ] = false;
            }
            P.emplace_back( i );
        }
    }
    return P;
}

int main() {
  int N, A, G, P{1};
  vector<int> primes = Eratosthenes(1000000);
  bool b[1000001]{};
  cin >> N;
  cin >> G;
  int g = G;
  for (auto p : primes) {
    while(g % p == 0) {
      b[p] = 1;
      g /= p;
    }
    if (g == 1) break;
  }
  while (cin >> A) {
    G = gcd(G, A);
    if (P) {
      if (is_prime[A]) {
        if (!b[A]) b[A] = 1;
        else P = 0;
      } else {
        for (auto p : primes) {
          if (A % p == 0) {
            if (b[p]) {
              P = 0;
              break;
            } else {
              b[p] = 1;
              while(A % p == 0) A /= p;
            }
          }
          if (A == 1 || !P) break;
        }
      }
    }
  }
  cout << (P ? "pairwise coprime"
             : (G == 1) ? "setwise coprime" : "not coprime")
       << endl;
}
