#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <vector>
#include <set>
using namespace std;

std::vector<int> Eratosthenes( const int N )
{
    std::vector<bool> is_prime( N + 1 );
    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);
  set<int> s;
  cin >> N;
  cin >> G;
  int g = G;
  while(g != 1) {
    for (auto p : primes) {
      while(g % p == 0) {
        s.insert(p);
        g /= p;
      }
    }
  }
  while (cin >> A) {
    G = gcd(G, A);
    if (P) {
      for (auto p : primes) {
        while(A % p == 0) {
          if (s.count(p)) {
            P = 0;
            break;
          } else {
            s.insert(p);
            while(A % p == 0) A /= p;
          }
        }
        if (A == 1 || !P) break;
      }
    }
  }
  cout << (P ? "pairwise coprime"
             : (G == 1) ? "setwise coprime" : "not coprime")
       << endl;
}
