using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            Array.Sort(a);

            if (Pairs(a).All(nums => GCD(nums) == 1))
            {
                Console.WriteLine("pairwise coprime");
                return;
            }
            if (IsSetwiseCoprime(a))
            {
                Console.WriteLine("setwise coprime");
                return;
            }
            Console.WriteLine("not coprime");
        }

        static IEnumerable<(int, int)> Pairs(int[] nums)
        {
            for (int i = 0; i < nums.Length - 1; i++)
            {
                for (int j = i + 1; j < nums.Length; j++)
                {
                    yield return (nums[i], nums[j]);
                }
            }
        }

        static int GCD((int a, int b) num)
        {
            int a = num.b;
            int b = num.a;
            while (a % b != 0)
            {
                int tmp = a % b;
                a = b;
                b = tmp;
            }
            return b;
        }

        static bool IsSetwiseCoprime(IEnumerable<int> nums)
        {
            foreach(int denom in GeneratePrime(nums.Min()))
            {
                if (nums.All(n => n % denom == 0)) return true;
            }
            return false;
        }

        public static List<int> GeneratePrime(int n)
        {
            var sqrtMax = Math.Sqrt(n);
            var isPrimes = Enumerable.Repeat(true, n - 1).ToArray();

            for (int i = 2; i < sqrtMax; ++i)
            {
                for (int j = i * 2; j <= n; j += i)
                {
                    isPrimes[j - 2] = false;
                }
            }

            return Enumerable.Range(2, n - 1).Where(x => isPrimes[x - 2]).ToList();
        }
    }
}