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

namespace AtCoder.E
{
    public class Program
    {
        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var N = ReadLong();
            var A = ReadLongs();

            var oneCount = A.Count(x => x == 1);

            // すべて1の場合
            if (oneCount == N) return "pairwise coprime";

            var primeCount = new long[1000001];
            foreach (var item in A.Where(x => x != 1))
            {
                foreach (var factor in GetPrimeFactors(item))
                {
                    primeCount[factor]++;
                }
            }

            var max = primeCount.Max();

            if (oneCount != 0)
            {
                // 1 以外が素の場合
                if (max == 1) return "pairwise coprime";
                return "setwise coprime";
            }

            if (max == 1) return "pairwise coprime";
            if (max == N) return "not coprime";
            return "setwise coprime";
        }
        public static IEnumerable<long> GetPrimeFactors(long n)
        {
            for (long a = 2; a * a <= n; ++a)
            {
                if (n % a != 0) continue;

                // 割れる限り割り続ける
                while (n % a == 0)
                {
                    //yield return a;
                    n /= a;
                }

                // TODO：重複を許さない場合はここで返す
                yield return a;

            }

            // 最後に残った数について
            if (n != 1) yield return n;
        }
        #region Console.Read

        public static string ReadText() { return Console.ReadLine(); }
        public static List<string> ReadTexts() { return Console.ReadLine().Split(' ').ToList(); }
        public static long ReadLong() { return long.Parse(Console.ReadLine()); }
        public static (long, long) Read2Longs() { var ls = ReadLongs(); return (ls[0], ls[1]); }
        public static (long, long, long) Read3Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2]); }
        public static (long, long, long, long) Read4Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3]); }
        public static (long, long, long, long, long) Read5Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3], ls[4]); }
        public static List<long> ReadLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }

        #endregion
    }
}
