#include <bits/stdc++.h>
using namespace std;

int main()
{
	int64_t n;
	cin >> n;
	vector<int64_t> as(n);
	for (auto &&a : as)
	{
		cin >> a;
	}

	bool s = [&] {
		int64_t g = 0;
		for (auto &&a : as)
		{
			g = gcd(g, a);
		}
		return (g == 1);
	}();

	bool p = [&] {
		vector<int64_t> d(1000001, -1);
		for (int64_t i = 2; i * i <= 1000000; i++)
		{
			if (d[i] == -1)
			{
				for (int64_t j = i; j <= 1000000; j += i)
				{
					d[j] = i;
				}
			}
		}

		vector<set<int64_t>> v(n);
		for (int64_t i = 0; i < n; i++)
		{
			if (as[i] == 1)
			{
				continue;
			}

			while (as[i] != 1)
			{
				v[i].insert(d[as[i]]);
				as[i] /= d[as[i]];
			}
		}

		for (int64_t i = 0; i < n; i++)
		{
			for (int64_t j = i + 1; j < n; j++)
			{
				for (int64_t x : v[i])
				{
					if (v[j].find(x) != v[j].end())
					{
						return false;
					}
				}
			}
		}
		return true;
	}();

	if (p)
	{
		cout << "pairwise coprime" << endl;
	}
	else if (s)
	{
		cout << "setwise coprime" << endl;
	}
	else
	{
		cout << "not coprime" << endl;
	}

	return 0;
}