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 Factor.AggregateByFactors(sieve.GetFactors(a)).Select(x => x.Factor))
            {
                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 Factor
{
    public static IEnumerable<long> GetFactors(long n)
    {
        for (long i = 2; i * i <= n; i++)
        {
            if (n % i != 0)
                continue;

            while (n % i == 0)
            {
                yield return i;
                n /= i;
            }
        }
        if (n != 1)
            yield return n;
    }

    public static IEnumerable<(int Factor, int Count)> AggregateByFactors(IEnumerable<int> factors) => AggregateByFactors(factors.Select(x => (long)x)).Select(x => ((int)x.Factor, x.Count));
    
    public static IEnumerable<(long Factor, int Count)> AggregateByFactors(IEnumerable<long> factors)
    {
        var isFirst = true;
        var prevFactor = 0L;
        var count = 0;

        foreach (var factor in factors)
        {
            if (!isFirst && prevFactor != factor)
            {
                yield return (prevFactor, count);
                count = 0;
            }
            else
                isFirst = false;

            count++;
            prevFactor = factor;
        }

        if (!isFirst)
            yield return (prevFactor, count);
    }
}

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: 118016