#include <bits/stdc++.h>

bool check_pairwise_coprime(std::vector<int> const &A)
{
    int lcm = A[0];
    for (int i = 1; i < A.size(); i++)
    {
        int gcd = std::__gcd(lcm, A[i]);
        if (gcd != 1)
            return false;
        lcm = lcm * A[i] / gcd;
    }
    return true;
}

bool check_setwise_coprime(std::vector<int> const &A)
{
    int tmp = A[0];
    for (int i = 1; i < A.size(); i++)
    {
        tmp = std::__gcd(tmp, A[i]);
    }
    return tmp == 1;
}

int main()
{
    int N;
    std::cin >> N;
    std::vector<int> A(N);
    for (auto &&e : A)
        std::cin >> e;

    if (check_pairwise_coprime(A))
        std::cout << "pairwise coprime" << std::endl;
    else if (check_setwise_coprime(A))
        std::cout << "setwise coprime" << std::endl;
    else
        std::cout << "not coprime" << std::endl;
}