#include <bits/stdc++.h>
using namespace std;
long long const INF = 1LL << 60;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vector<long long> right(N + 1, 0);
  for (int i = N - 1; i >= 0; --i) right[i] = gcd(right[i + 1], A[i]);
  bool is_pair_coprime = true;
  for (int i = 0; i + 1 < N; i++) {
    cout << A[i] << " " << right[i + 1] << endl;
    long long is_pc = gcd(A[i], right[i + 1]);
    if (is_pc != 1) {
      is_pair_coprime = false;
      break;
    }
  }
  if (is_pair_coprime) {
    cout << "pairwise coprime" << endl;
  } else if (right[0] == 1) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  return 0;
}
