#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <stdbool.h>
#include <assert.h>

struct Vector {
    int size, lastptr, *array;
};
void init(struct Vector* vector, int n) {
    vector->array = (int *) calloc (n, sizeof(int));
    vector->size = n;
    vector->lastptr = 0;
    assert(vector->array && "init broken");
}
void resize(struct Vector* vector) {
    vector->array = (int *) realloc(vector->array, 2*vector->size);
    vector->size *= 2;
}
void push_back(struct Vector* vector, int a) {
    if (vector->lastptr == vector->size) {
        resize(vector);
        push_back(vector, a);
    } else {
        vector->array[vector->lastptr++] = a;
    }
}
void delete(struct Vector* vector) {free(vector->array);}
int gcd(int a, int b) {if (b == 0) {return a;}return gcd(b, a%b);}

bool pairwise=true, setwise=false;
int pot[1000001], N, arr[1000000];
bool vis[1000001];
bool chk[1000001];
void sieve() {
    int i, j;
    pot[0]=1;
    pot[1]=1;
    for (i=2; i <= 1000000; i+=2) {
        pot[i] = 2;
    }
    for (i=3; i <= 1000000; i+=2) {
        if (!pot[i]) {
            for (j=1; i*j <= 1000000; j++) {
                if (!pot[i*j]) {
                    pot[i*j] = i;
                }
            }
        }
    }
}
int main(void) {
    sieve();
    scanf("%d", &N);
    int i;
    for (i=0; i < N; ++i) {
        scanf("%d", arr+i);
    }
    int pairgcd = gcd(arr[0], arr[1]);
    for (i=2; i < N; i++) {
        pairgcd = gcd(pairgcd, arr[i]);
    }
    if (pairgcd == 1) setwise=true;
    struct Vector vec[N];
    for (i=0; i < N; i++) {
        int x = *(arr+i);
        memset(chk, false, sizeof(chk));
        init(&vec[i], 1000001);
        while(x > 1) {
            if (!chk[pot[x]]) {
                chk[pot[x]] = true;
                push_back(&vec[i], pot[x]);// check this whole & vs !& thing
            }
            x /= pot[x];
        }
        int j=0;
        for (j=0; j < vec[i].lastptr; j++) {
            if (vis[vec[i].array[j]]) {
                pairwise = false;
            }
            vis[vec[i].array[j]] = true;
        }
        delete(&vec[i]);
    }
    if (pairwise) {
        printf("pairwise coprime\n");
    } else if (setwise) {
        printf("setwise coprime\n");
    } else {
        printf("not coprime\n");
    }
    return 0;
}

