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

namespace E
{
    class Program
    {
        static List<int> min_factor = new List<int>();
        static void Main(string[] args)
        {
            var n = Int32.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split(" ").Select(s => Int32.Parse(s)).ToList();

            min_factor = new List<int>();
            for(var i=0;i<=1000000;i++){
                min_factor.Add(i); 
            }
            for(int i=2; i*i<=1000000; i++){
                if(min_factor[i] < i) continue;
                for(int j=i*i; j<=1000000; j+=i){
                    if(min_factor[j] == j) min_factor[j] = i;
                }
            }
            var values = new Dictionary<int, int>();
            foreach (var val in a)
            {
                var facts = PrimeFactors(val);
                foreach (var hoge in facts)
                {
                    if(!values.ContainsKey(hoge)) values[hoge] = 0;
                    values[hoge]++;
                }
            }



            bool flag1 = true;
            var f2 = true;
            foreach(var v in values){
                if(v.Key == 1) continue;
                if(v.Value > 1) {
                    flag1 = false;
                }
                if(v.Value >= n) {
                    f2 = false; 
                }
            }
            if(flag1) {
                Console.WriteLine("pairwise coprime");
                return;
            }
            else if(f2) {
                Console.WriteLine("setwise coprime");
                return;
            }
            Console.WriteLine("not coprime");
        }
        public static IEnumerable<int> PrimeFactors(int n)
        {
            int tmp = n;

            while (tmp > 1)
            {
                yield return tmp;
                tmp = tmp / min_factor[tmp];
            }
            yield return 1;
        }
    }
}