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.List;
import java.util.Scanner;
import java.util.Set;

class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int arr[] = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = sc.nextInt();
		}
		boolean primes[] = new boolean[1000001];
		sieveOfEratosthenes(primes, 1000000);
		List<Integer> list = new ArrayList<Integer>();
		Set<Integer> set = new HashSet<Integer>();
		for (int i = 0; i < 1000001; i++) {
			if (primes[i]) {
				list.add(i);
				set.add(i);
			}
		}
		boolean poss = true;
		for (int i = 0; i < n; i++) {
			int temp = arr[i];
			for (int j = 0; j < n && list.get(j) < temp; j++) {
				int div = list.get(j);
				if (primes[temp] == true) {
					div = temp;
				}
				if (temp % div == 0) {
					if (set.contains(div)) {
						set.remove(div);
					}
					else {
						poss = false;
						i = n; break;
					}
					while (temp % div == 0) temp = temp / div;
				}
			}
		}
		int gcd = arr[0];
		for (int i = 1; i < n; i++) {
			gcd = gcd(arr[i], gcd);
		}
		if (poss) {
			System.out.println("pairwise coprime");
		}
		else if (gcd == 1) {
			System.out.println("setwise coprime");
		}
		else {
			System.out.println("not coprime");
		}

	}
	
	 static void sieveOfEratosthenes(boolean prime[], int n) { 
	        for(int i=2;i<n;i++) 
	            prime[i] = true; 
	          
	        for(int p = 2; p*p <=n; p++) 
	        { 
	            // If prime[p] is not changed, then it is a prime 
	            if(prime[p] == true) 
	            { 
	                // Update all multiples of p 
	                for(int i = p*p; i <= n; i += p) 
	                    prime[i] = false; 
	            } 
	        }
	    } 
	
	public static int gcd(int a, int b) {
		if (b == 0) {
			return a;
		}
		
		return gcd(b, a % b);
	}

}
