#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#include <string>
#include <limits.h>
#include <iomanip>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <set>
#include <bitset>
#include <unordered_map>
#include <string.h>
#define fastIo                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL)
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define MOD 1000000007

using namespace std;
bool ch[1000001];
bool pairwise(int arr[], int n)
{
    int d = arr[0];
    for (int i = 2; i * i <= arr[0] * arr[0]; i++)
    {
        if (d % i == 0)
        {
            while (d % i == 0)
            {
                d /= i;
            }
            ch[d] = true;
        }
    }
    if (d != 1)
        ch[d] = true;

    for (int i = 1; i < n; i++)
    {
        d = arr[i];
        for (int i = 2; i * i <= arr[i] * arr[i]; i++)
        {
            if (d % i == 0)
            {
                while (d % i == 0)
                {
                    d /= i;
                }

                if (ch[d] == true)
                    return false;
                else
                {
                    ch[d] = true;
                }
            }
        }
        if (d != 1)
        {
            if (ch[d])
                return false;
            ch[d] = true;
        }
    }

    return true;
}
bool setWise(int arr[], int n)
{
    int g = arr[0];
    for (int i = 1; i < n; i++)
        g = __gcd(g, arr[i]);

    return g == 1;
}

int main()
{
    fastIo;

    int n;
    cin >> n;

    int arr[n];
    for (int i = 0; i < n; i++)
        cin >> arr[i];
    if (pairwise(arr, n))
        cout << "pairwise coprime";
    else if (setWise(arr, n))
        cout << "setwise coprime";
    else
    {
        cout << "not coprime";
    }

    return 0;
}