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.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		int []arr =new int[n];
		int max=1;
		for(int i=0;i<n;i++){
			arr[i]=scn.nextInt();
			max=Math.max(arr[i], max);
		}
		  res(arr,max);

	}
	public static void res(int []arr ,int max){
		int [] spf =new int[max+1];
		spf[1]=1;
	  for(int i=0;i<=max;i++){
		  spf[i]=i;
	  }
		for(int i=2;i<=max;i+=2){
			spf[i]=2;
		}
		for(int i=3;i*i<=max;i++){
			if(spf[i]==i){
			for(int j=i*i;j<=max;j+=i){
				if(spf[j]==j){
					spf[j]=i;
				}
			}
			
			}
		}
//		for(int i=0;i<spf.length;i++){
//			System.out.println(spf[i]);
//		}
		
		HashSet<Integer>hs2 =new HashSet<>();
		int ans=0;
		boolean f=false;
	  for(int i=0;i<arr.length;i++){
		  
		  HashSet<Integer> hs =pf(arr[i],spf);
		  ans+=hs.size();
		  for(int val :hs){
			  hs2.add(val);
		  }
		 // System.out.println(hs2.size()+" "+ans);
		  if(hs2.size()!=ans){
			  f=true;
			  break;
		  }
		  
	  }
	 
	  if(f==false){
		  System.out.println("pairwise coprime");
		  return ;
	  }else{
		  int gcd=arr[0];
		for(int i=1;i<arr.length;i++){
			gcd=gcd(gcd,arr[i]);
			if(gcd==1){
				System.out.println("setwise coprime");
				return ;
			}
		}
	  }
	  System.out.println("not coprime");
		
	}
	public static int gcd(int a ,int b){
		if(b==0){
			return a;
		}
		
		return gcd(b,a%b);
	}
	public static HashSet<Integer>  pf(int val,int [] spf){
		HashSet<Integer> hs =new HashSet<>();
		while(val!=1){
			hs.add(spf[val]);
			val/=spf[val];
		}
		return hs;
	}

}