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

class Program
{
  static void Main(string[] args)
  {
    bool isPC = true;
    bool isSC = true;

    uint N = uint.Parse(Console.ReadLine());
    int[] A = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);

    uint[] primeMap = new uint[(int)Math.Pow(10, 6)];

    for (int i = 0; i < A.Length; i++)
    {
      IEnumerable<int> primes = GetPrimes(A[i]).Distinct();
      foreach (var prime in primes)
      {
        if (primeMap[prime] != 0)
        {
          isPC = false;
        }

        primeMap[prime] += 1;
      }
    }

    if (primeMap.Max() == N)
    {
      isSC = false;
    }

    if (isPC)
    {
      Console.WriteLine("pairwise coprime");
    }
    else if (isSC)
    {
      Console.WriteLine("setwise coprime");
    }
    else
    {
      Console.WriteLine("not coprime");
    }
    return;
  }

  public static IEnumerable<int> GetPrimes(int n)
  {
    int prime = 2;
    int tmp = n;

    //i <= sqrt(n)
    while (prime * prime <= n)
    {
      if (tmp % prime == 0)
      {
        //DO NOT INCREMENT PRIME.
        tmp /= prime;
        yield return prime;
      }
      else
      {
        prime++;
      }
    }

    if (tmp != 1)
    {
      yield return tmp;
    }
  }
}