We have N integers. The i-th number is A_i.

\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.

\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.

Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.

Here, GCD(\ldots) denotes greatest common divisor.

Constraints

* 2 \leq N \leq 10^6
* 1 \leq A_i\leq 10^6

Input

Input is given from Standard Input in the following format:


N
A_1 \ldots A_N


Output

If \\{A_i\\} is pairwise coprime, print `pairwise coprime`; if \\{A_i\\} is setwise coprime, print `setwise coprime`; if neither, print `not coprime`.

Examples

Input

3
3 4 5


Output

pairwise coprime


Input

3
6 10 15


Output

setwise coprime


Input

3
6 10 16


Output

not coprime
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Set;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int T = 1;
            while (T-- > 0)
            {
                solveOne(in, out);
            }
        }

        private void solveOne(Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            int nums[] = CPUtils.readIntArray(N, in);

            boolean ok = true;
            Arrays.sort(nums);
            Set<Integer> set = new HashSet<>();
            for (int el : nums)
            {
                if (el != 1 && set.contains(el))
                {
                    ok = false;
                    break;
                }
                set.add(el);
            }

            Set<Integer> divisors = new HashSet<>();
            for (int i = N - 1; i >= 0 && ok; i--)
            {
                if (divisors.contains(nums[i]))
                {
                    ok = false;
                    break;
                }
                for (int div = 2; div <= Math.sqrt(nums[i]); div++)
                {
                    if (nums[i] % div == 0)
                    {
                        if (divisors.contains(div) || divisors.contains(nums[i] / div))
                        {
                            ok = false;
                            break;
                        }
                        divisors.add(div);
                        divisors.add(nums[i] / div);
                    }
                }
            }

            if (ok)
            {
                out.println("pairwise coprime");
                return;
            }

            ok = true;
            int gcd = nums[0];
            for (int i = 1; i < N; i++)
            {
                gcd = CPUtils.gcd(gcd, nums[i]);
            }
            if (gcd != 1) ok = false;
            if (ok)
            {
                out.println("setwise coprime");
                return;
            }
            out.println("not coprime");
        }

    }

    static class CPUtils
    {
        public static int[] readIntArray(int size, Scanner in)
        {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
            {
                array[i] = in.nextInt();
            }
            return array;
        }

        public static int gcd(int n1, int n2)
        {
            if (n2 == 0)
            {
                return n1;
            }
            return gcd(n2, n1 % n2);
        }

    }
}

