#include <bits/stdc++.h>
using namespace std;
#define REP(i,b,e) for(int i=(b);i<(e);++i)
#define RREP(i,b,e) for(int i=(b)-1;i>=e;--i)
#define rep(i,e) for(int i=0;i<(e);++i)

constexpr int MOD = 1000000007;
constexpr int INF = 1LL << 30;
constexpr long long LLINF = 1LL << 62;
constexpr double EPS = 1e-9;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15) << boolalpha;
  }
} initializer;

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (auto it = vec.begin(); it != vec.end(); ++it) {
    if (it != vec.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}

template<typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &pa) {
  return os << "(" << pa.first << ", " << pa.second << ")";
}

template<typename Tuple, size_t N>
struct TuplePrinter {
  static void print(const Tuple &t) {
    TuplePrinter<Tuple, N-1>::print(t);
    cout << ", " << get<N-1>(t);
  }
};

template<typename Tuple>
struct TuplePrinter<Tuple, 1> {
  static void print(const Tuple &t) {
    cout << get<0>(t);
  }
};

template<typename... T>
ostream &operator<<(ostream &os, const tuple<T...> &tup) {
  os << "(";
  TuplePrinter<decltype(tup), sizeof...(T)>::print(tup);
  return os << ")";
}

template<typename T>
ostream &operator<<(ostream &os, const set<T> &se) {
  os << "{";
  for (auto it = se.begin(); it != se.end(); ++it) {
    if (it != se.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}

template<typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &ma) {
  os << "{";
  for (auto it = ma.begin(); it != ma.end(); ++it) {
    if (it != ma.begin()) os << ", ";
    os << it->first << ": " << it->second;
  }
  return os << "}";
}

inline void print(void) { cout<<'\n'; }
template<class T> inline void print(const T &x) { cout<<x<<'\n'; }
template<class T, class... U> inline void print(const T &x, const U&... y) { cout<<x<<" "; print(y...); }

#define MAXN 1000001
// Stores smallest prime factor for every number 
int spf[MAXN]; 
  
// Hash to store prime factors count 
int hash1[MAXN] = { 0 }; 
  
// Function to calculate SPF (Smallest Prime Factor) 
// for every number till MAXN 
void sieve() 
{ 
    spf[1] = 1; 
    for (int i = 2; i < MAXN; i++) 
  
        // Marking smallest prime factor for every 
        // number to be itself 
        spf[i] = i; 
  
    // Separately marking spf for every even 
    // number as 2 
    for (int i = 4; i < MAXN; i += 2) 
        spf[i] = 2; 
  
    // Checking if i is prime 
    for (int i = 3; i * i < MAXN; i++) { 
  
        // Marking SPF for all numbers divisible by i 
        if (spf[i] == i) { 
            for (int j = i * i; j < MAXN; j += i) 
  
                // Marking spf[j] if it is not 
                // previously marked 
                if (spf[j] == j) 
                    spf[j] = i; 
        } 
    } 
} 
  
// Function to store the prime factors after dividing 
// by the smallest prime factor at every step 
void getFactorization(int x) 
{ 
    int temp; 
    while (x != 1) { 
        temp = spf[x]; 
        if (x % temp == 0) { 
  
            // Storing the count of 
            // prime factors in hash 
            hash1[spf[x]]++; 
            x = x / spf[x]; 
        } 
        while (x % temp == 0) 
            x = x / temp; 
    } 
} 
  
// Function that returns true if there are 
// no common prime factors between x 
// and other numbers of the array 
bool check(int x) 
{ 
    int temp; 
    while (x != 1) { 
        temp = spf[x]; 
  
        // Checking whether it common 
        // prime factor with other numbers 
        if (x % temp == 0 && hash1[temp] > 1) 
            return false; 
        while (x % temp == 0) 
            x = x / temp; 
    } 
    return true; 
} 
  
// Function that returns true if there is 
// an element in the array which is coprime 
// with all the other elements of the array 
bool isPairCoprime(vector<int> arr, int n) 
{ 
    // Using sieve for generating prime factors 
    sieve(); 
  
    for (int i = 0; i < n; i++) 
        getFactorization(arr[i]); 
  
    // Checking the common prime factors 
    // with other numbers 
    for (int i = 0; i < n; i++) 
        if (!check(arr[i])) return false;

    return true;
} 

template<typename T>
T gcd(T a, T b) {
  while (a) {
    b %= a;
    swap(a, b);
  }
  return b;
}

int main() {
  int n; cin>>n;
  vector<int> a(n);
  rep(i, n) cin>>a[i];
  bool pairwise = false, setwise = false;

  int g = a[0];
  REP(i, 1, n) g = gcd(g, a[i]);

  if (g == 1) setwise = true;
  pairwise = isPairCoprime(a, n);

  if (pairwise) print("pairwise coprime");
  else if (setwise) print("setwise coprime");
  else print("not coprime");


  return 0;
}

Measured memory_bytes: 18628