using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static void Main(string[] args)
    {
        var N = int.Parse(ReadLine());
        var A = ReadLine().Split(' ').Select(int.Parse).ToArray();

        var isPairCoprime = true;
        var sieve = new SieveOfEratosthenes(1_000_000);
        var set = new HashSet<int>();
        foreach (var a in A)
        {
            foreach (var fact in sieve.GetFactors(a).RunLengthEncode().Select(x => x.element))
            {
                if (set.Contains(fact))
                {
                    isPairCoprime = false;
                    goto LOOP_END;
                }
                set.Add(fact);
            }
        }
    LOOP_END:

        var isSetwiseCoprime = A.Aggregate((s, e) => MathExt.Gcd(s, e)) == 1;

        var ans = (isPairCoprime) ? "pairwise coprime" : (isSetwiseCoprime) ? "setwise coprime" : "not coprime";

        WriteLine(ans);
    }
}

static partial class MathExt
{
    public static int Gcd(int a, int b) => (int)Gcd((long)a, b);
    public static long Gcd(long a, long b) => (b != 0) ? Gcd(b, a % b) : a;
    public static long Lcm(long a, long b) => a / Gcd(a, b) * b;
}

static class RunLengthEncoderExtensions
{
    public static IEnumerable<(T element, int length)> RunLengthEncode<T>(this IEnumerable<T> collection)
    {
        var isFirst = true;
        var prevElement = default(T);
        var length = 0;

        foreach (var element in collection)
        {
            if (!isFirst && !EqualityComparer<T>.Default.Equals(prevElement, element))
            {
                yield return (prevElement, length);
                length = 0;
            }
            else
                isFirst = false;

            length++;
            prevElement = element;
        }
        if (!isFirst)
            yield return (prevElement, length);
    }

    public static IEnumerable<T> RunLengthDecode<T>(this IEnumerable<(T element, int length)> rle) => rle.SelectMany(t => Enumerable.Repeat(t.element, t.length));
}

class SieveOfEratosthenes
{
    public int MaxN { get; }

    public IEnumerable<int> Primes => primes;
    private readonly List<int> primes = new List<int>();
    private readonly int[] factors;
     
    public SieveOfEratosthenes(int maxN)
    {
        MaxN = maxN;
        factors = new int[maxN + 1];
        factors[0] = factors[1] = -1;

        for (int i = 2; i <= maxN; i++)
        {
            if (factors[i] != 0)
                continue;

            primes.Add(i);

            for (int j = i; j <= maxN; j += i)
                factors[j] = i;
        }
    }

    public bool IsPrime(int n)
    {
        if (MaxN < n)
            throw new ArgumentException();

        if (n < 2)
            return false;

        return factors[n] == n;
    }

    public IEnumerable<int> GetFactors(int n)
    {
        if (MaxN < n)
            throw new ArgumentException();

        var oppositeFactors = new List<int>();
        while (1 < n)
        {
            oppositeFactors.Add(factors[n]);
            n /= factors[n];
        }

        for (int i = oppositeFactors.Count - 1; i >= 0; i--)
            yield return oppositeFactors[i];
    }
}


Measured memory_bytes: 109616