#include <bits/stdc++.h>
using namespace std;
bool sortbysecond(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second > b.second);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <typename T>
string NumberTostring(T Number) {
  ostringstream second;
  second << Number;
  return second.str();
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> vec(n);
  long long tgcd = 0;
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
    tgcd = gcd(vec[i], tgcd);
  }
  if (tgcd != 1) {
    cout << "not coprime"
         << "\n";
  } else {
    int f1 = 0;
    bool prime[1000001];
    memset(prime, true, sizeof(prime));
    for (int p = 2; p * p <= 1000001; p++) {
      if (prime[p] == true) {
        for (int i = p * p; i <= 1000001; i += p) {
          prime[i] = false;
        }
      }
    }
    vector<long long> op;
    long long cnt = 0;
    for (int i = 2; i < 1000001; i++) {
      if (prime[i] == true) {
        cnt++;
        op.push_back(i);
      }
    }
    cout << cnt << "\n";
    for (long long o = 0; o < 500; o++) cout << op[o] << " ";
    cout << op.size() << "\n";
    bool pr[1000001];
    memset(pr, false, sizeof(pr));
    for (int i = n - 1; i >= 0; i--) {
      for (int j = 0; j < op.size(); j++) {
        if (vec[i] % op[j] == 0) {
          if (pr[op[j]] == true) {
            f1 = 1;
          } else {
            pr[op[j]] = true;
          }
        }
      }
    }
    if (f1 == 0) {
      cout << "pairwise coprime"
           << "\n";
    } else {
      cout << "setwise coprime"
           << "\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
