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();


            if (Pairs(a).All(nums => GCD(nums) == 1))
            {
                Console.WriteLine("pairwise coprime");
                return;
            }
            if (IsNotCoprime(a))
            {
                Console.WriteLine("not coprime");
                return;
            }
            Console.WriteLine("setwise 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 IsNotCoprime(IEnumerable<int> nums)
        {
            var primes = new List<int>();

            var list= nums.Select(num => PrimeFactors(num).Distinct());

            foreach(var n in PrimeFactors(nums.Min()).Distinct())
            {
                if (list.All(l => l.Any(a => a == n))) return true;
            }
            return false;
        }

        public static IEnumerable<int> PrimeFactors(int n)
        {
            int i = 2;
            int tmp = n;

            while (i * i <= n)
            {
                if (tmp % i == 0)
                {
                    tmp /= i;
                    yield return i;
                }
                else
                {
                    i++;
                }
            }
            if (tmp != 1) yield return tmp;
        }
    }
}