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.*;
import java.util.*;
// i want to become the best
class Main{
	public static HashMap<Long,Integer> hmprod = new HashMap<>();
	public static HashMap<Long,Integer> hmlcm = new HashMap<>();
	//public static long[] list = new 
	public static void main(String[] args) throws Exception{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		long[] list = Arrays.stream(reader.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
	    //System.out.println(list[1]*list[2]>=list[0]?"Yes":"No");
		long gcd = list[0];
		for(int i = 0;i<n;i++){
			if(i!=0) {
				gcd = GCD(gcd,list[i]);
			}
			//lcm(list[i]);
			prod(list[i]);
		}
		if(hmprod.equals(hmlcm)) System.out.println("pairwise coprime");
		else if(gcd==1) System.out.println("setwise coprime");
		else System.out.println("not coprime");
	}
	static long GCD(long a, long b) 
    { 
    	long sum = a+b;
    	b = Math.max(b,a);
    	a = sum-b;
     while (b > 0)
    {
        long temp = b;
        b = a % b; // % is remainder
        a = temp;
    }
    return a;    } 
	public static void prod(long a){
		if(a%2==0){
			int j = 0;
			while(a%2==0){
				a=a/2;
				j++;
			}
			hmprod.put(2L,j+hmprod.getOrDefault(2L,0));
			hmlcm.put(2L,Math.max(j,hmlcm.getOrDefault(2L,0)));
		}
		for(long i = 3;i*i<=a;i=i+2){
			if(a%i==0){
				int cnt = 0;
				while(a%i==0){
					a=a/i;
					cnt++;
				}
				hmprod.put(i,cnt+hmprod.getOrDefault(i,0));
				hmlcm.put(i,Math.max(cnt,hmlcm.getOrDefault(i,0)));
			}
		}
		if(a!=1) hmprod.put(a,1+hmprod.getOrDefault(a,0));
		if(a!=1) hmlcm.put(a,Math.max(1,hmlcm.getOrDefault(a,0))); 
	}
}
class pair implements Comparable<pair>{
		long a = 0;
		int b = 0;
		public pair(long a,int b){
			this.a = a;
			this.b = b;
		}
		@Override
		public int compareTo(pair p){
			if(this.a == p.a) return -(Integer.compare(this.b,p.b));
			else return -(Long.compare(this.a,p.a));
		}
		@Override
		public String toString(){
			return a+" "+b;
		}
	}
