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

public class Prime
{
    BitArray Sieve;
    // Sieve of Eratosthenes
    public void Init(int max)
    {
        Sieve = new BitArray(max + 1);
        var end = (int)(Math.Sqrt(max) + 0.1);
        Sieve.Set(1, true);
        for (int i = 2; i <= end; i++)
        {
            if (!Sieve.Get(i))
            {
                for (int j = i * 2; j <= max; j += i)
                {
                    Sieve.Set(j, true);
                }
            }
        }
    }

    public bool IsPrime(int n)
    {
        return !Sieve.Get(n);
    }

    public int[] GetPrimes(int n)
    {
        return Enumerable.Range(2, n - 1).Where(i => !Sieve.Get(i)).ToArray();
    }
}

public class PrimeFactorize
{
    int[] Primes;

    public PrimeFactorize(long n)
    {
        var prime = new Prime();
        var max = (int)(Math.Sqrt(n) + 1);
        prime.Init(max);
        Primes = prime.GetPrimes(max);
    }

    static List<long> Factorize(long n, IEnumerable<int> primes)
    {
        var factor = new List<long>();
        foreach (var p in primes)
        {
            while (n % p == 0)
            {
                factor.Add(p);
                n /= p;
            }
        }
        if (n > 1)
        {
            factor.Add(n);
        }
        return factor;
    }

    public List<long> Factorize(long n)
    {
        return Factorize(n, Primes);
    }
}

public static class Solution
{
    public static void Main()
    {
        var N = int.Parse(Console.ReadLine());
        var A = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var pf = new PrimeFactorize((int)1e6);
        var factorCount = new int[(int)1e3 + 1];

        foreach (var a in A)
        {
            var fa = pf.Factorize(a);
            foreach (var f in fa.Distinct())
            {
                factorCount[f]++;
            }
        }

        var pairwise = factorCount.All(v => v <= 1);
        if (pairwise)
        {
            Console.WriteLine("pairwise coprime");
            return;
        }
        var setwise = factorCount.All(v => v != N);
        if (setwise)
        {
            Console.WriteLine("setwise coprime");
            return;
        }
        Console.WriteLine("not coprime");
    }
}