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

namespace E
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] A = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var L = new List<int>[n];
            var isPrime = new bool[A.Min()+1];
            bool check1 = true;
            bool check2 = true;
            for (int i = 0; i < n; i++)
            {
                //L[i] = new List<int>();
                L[i] = Sieve(A[i]);
            }
            
            for(int i = 0; i < n -1; i++)
            {
                for (int j = i + 1; j < n; j++)
                {
                    for(int x=0; x < L[i].Count; x++)
                    {
                        for(int y = 0; y < L[j].Count; y++)
                        {
                            if (x == 0 && y == 0) continue;
                            if (L[i][x] == L[j][y])
                            {
                                check1 = false;
                                if (!check1) break;
                            }
                            if (!check1) break;
                        }
                        if (!check1) break;
                    }
                    if (!check1) break;
                }
                if (!check1) break;
            }
            var NG = new List<int>{2,3,5,7,11,13};
            foreach(var g in NG)
            {
                bool ok = true;
                for(int i = 0; i < n; i++)
                {
                    if (!L[i].Contains(g)) ok = false;
                }
                if (ok) check2 = false;
            }
            if (check1) Console.WriteLine("pairwise coprime");
            else
            {
                if (check2) Console.WriteLine("setwise coprime");
                else Console.WriteLine("not coprime");
            }

        }
        static public long GCD(long m, long n)
        {
            if (m < n)
            {
                var tmp = m;
                m = n;
                n = tmp;
            }
            while (true)
            {
                var r = m % n;
                if (r == 0) return n;
                m = n;
                n = r;
            }
        }
        //約数を返す
        static public List<int> Sieve(int n)
        {
            var ret = new List<int>();
            ret.Add(1);
            for (int i=2; i <= (int)Math.Sqrt(n); i++)
            {
                if (n % i == 0)
                {
                    ret.Add(i);
                    while (n %i == 0)
                    {
                        n /= i;
                    }
                }
            }
            if (n != 1) ret.Add(n);
            return ret;
        }
    }
}
