#include <bits/stdc++.h>
//#define int long long

using namespace std;


signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    vector <int> prime;
    prime.push_back(2);
    vector <bool> check(500005, 0);
    check[2] = 1;
    for (int i = 3; i <= 500000; ++i) {
        if (check[i] == 1) continue;
        else {
            prime.push_back(i);
            for (int j = i + i; j <= 500000; j += i) check[j] = 1;
        }
    }
    int n;
    cin >> n;
    cout << prime.size() << endl;
    int data[n];
    for (int i = 0; i < n; ++i) cin >> data[i];
    int a = data[0];
    for (int i = 1; i < n; ++i) a = __gcd(a, data[i]);
    if (a != 1) {
        cout << "not coprime"; return 0;}
    int fl = 1;
    int fl2 = 1;
    vector <int> used(1000001, 0);
    for (int i = 0; i < n && fl; ++i) {
        for (int j = 0; j < int(prime.size()) && data[i] != 1; ++j) {
            if (fl == 0) break;
            if (data[i] % prime[j] == 0) {
                if (used[prime[j]] != 0) {
                    fl = 0;
                }
                used[prime[j]] += 1;
                if (used[prime[j]] >= n) {
                    fl2 = 0;
                }
            }
        }
    }
    if (fl2 == 1) {
        a = data[0];
        for (int i = 1; i < n; ++i) a = __gcd(a, data[i]);
        if (a != 1) fl2 = 0;
    }
    if (fl) cout << "pairwise coprime";
    else if (fl2) cout << "setwise coprime";
    else cout << "not coprime";
    return 0;
}
