#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
bool prime[1000006];
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < (N); ++i) cin >> A[i];
  for (int i = 0; i < (N); ++i) prime[A[i]] = 1;
  ll g = A[0];
  for (int i = 0; i < (N); ++i) g = gcd(g, A[i]);
  cout << g << '\n';
  if (g != 1) {
    puts("not coprime");
    return 0;
  }
  for (int i = 2; i < 1000006; i++) {
    int temp = 0;
    for (int j = i; j < 1000006; j += i) {
      if (prime[j]) temp++;
    }
    if (temp >= 2) {
      puts("setwise coprime");
      return 0;
    }
  }
  puts("pairwise coprime");
  return 0;
}
