#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef long long ll;
int n;
int a[1000005];
int c[1000005];
vector <int> p;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> n;
    for(int i = 1;i <= n;i++) {
        cin >> a[i];
    }
    for(int i = 2;i <= 1000000;i++) {
        if(c[i]) continue;
        p.push_back(i); c[i] = 1;
        if(i > 1000) continue;
        for(int j = i*i;j <= 1000000;j += i) c[j] = 1;
    }
    memset(c,0,sizeof(c));
    int ch = 1;
    for(int i = 1;i <= n;i++) {
        int x = a[i];
        for(int j : p) {
            if(x > 1000) break;
            if(j*j > x) break;
            if(x % j == 0) {
                if(c[j]) {
                    ch = 0;
                    break;
                }
                c[j] = 1;
                while(x % j == 0) x /= j;
            }
        }
        if(x != 1&&c[x]) {
            ch = 0;
            break;
        }
        if(!ch) break;
    }
    if(ch) {
        cout << "pairwise coprime\n";
        return 0;
    }
    int gcd = a[1];
    for(int i = 2;i <= n;i++) {
        gcd = __gcd(a[i],gcd);
    }
    if(gcd == 1) {
        cout << "setwise coprime\n";
        return 0;
    }
    cout << "not coprime\n";
    return 0;
}