#include <bits/stdc++.h>

bool check_pairwise_coprime(std::vector<int> const &A)
{
    for (int i = 0; i < A.size() - 1; i++)
    {
        for (int j = i + 1; j < A.size(); j++)
        {
            if (std::__gcd(A[i], A[i + 1]) != 1)
                return false;
        }
    }
    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;
}