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.*;
import java.io.*;
public class Main {
	static int gcd(int a, int b) {
		if(a==0)
			return b;
		return gcd(b%a, a);
	}
	static HashSet<Integer> primeFactors(int val){
		HashSet<Integer> hset=new HashSet<>();
		for(int i=2;i<=Math.sqrt(val);i++) {
			while(val%i==0) {
				val=val/i;
				hset.add(i);
			}
		}
		if(val>2) {
			hset.add(val);
		}
		return hset;
	}
	public static void main(String args[]) {
		FastScanner in = new FastScanner();
		int n=in.nextInt();
		int a[]=in.readArray(n);
		HashSet<Integer> set=new HashSet<>();
		boolean chk=true;
		L: for(int i=0;i<n;i++) {
			HashSet<Integer> hset=new HashSet<>(primeFactors(a[i]));
			for(int val: hset) {
				if(set.contains(val)) {
					chk=false;
					break L;
				}
				set.add(val);
			}
		}
		if(!chk) {
			int result=a[0];
			for(int i=0;i<n;i++) {
				result=gcd(result, a[i]);
			}
			if(result==1) {
				System.out.println("setwise coprime");
			}
			else {
				System.out.println("not coprime");
			}
		}
		else {
			System.out.println("pairwise coprime");
		}
	}

	///////////////////////////
	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		long nextLong() {
			return Long.parseLong(next());
		}
	}
}
