#include <bits/stdc++.h>

using namespace std;

const int m = 1000000;
int n, h[m + 5];
bool f, g;

int main() {
    scanf("%d", &n);
    for (int i = 1, t; i <= n; i++)
        scanf("%d", &t), h[t]++;
    f = g = true;
    for (int i = 2; i <= m; i++) {
        int tot = 0;
        for (int j = i; j <= m; j += i)
            tot += h[j];
        if (tot > 1)
            f = false;
        if (tot == n)
            g = false;
    }
    if (f)
        printf("pairwise coprime");
    else if (g)
        printf("setwise coprime");
    else
        printf("not coprime");
    return 0;
}