#include <iostream>
#include <numeric>
#include "vector"
#include "map"
using namespace std;

typedef long long ll;
const ll M = (ll)1e9 + 7;
const int N = (int)2e5 + 10;
string verdicts[]{
        "pairwise coprime",
        "setwise coprime",
        "not coprime",
};
bool is_prime[1001];
int cnt[N];
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(auto &i : a)
        cin >> i;

    is_prime[1] = false;
    is_prime[2] = true;
    for(int i = 3; i <= 1000; i++)
        is_prime[i] = true;
    for(int i = 2; i <= 1000; i++)
        if(is_prime[i])
            for(int j = i + i; j <= 1000; j += i)
                is_prime[j] = false;
    vector<int> p;
    for(int i = 2; i <= 1000; i++)
        if(is_prime[i]) p.push_back(i);
    map<int, int> d;
    /* for(auto &x: p)
         cout << x << ' ';
     cout << endl;*/
    int answer = 2;
    int g = a[0];
    for(int i = 1; i < n; i++)
        g = gcd(a[i], g);
    if(g == 1) answer = 1;
    bool cans = true;
    for(int i = n - 1; i >= 0; i--) {
        for(auto j : p) {
            if(j * j > a[i])
                break;
            if(a[i] % j == 0) {
                if(cnt[j])
                    cans = 0;
                cnt[j]++;
                while(a[i] % j == 0){
                    a[i] /= j;
                }
            }
        }
        if(a[i] != 1){
            if(cnt[a[i]])
                cans = 0;
            cnt[a[i]]++;
        }
    }
    if(cans)
        answer = 0;
    cout << verdicts[answer];
}