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.*;
import java.util.function.*;

final class Solver {
	void solve(Supplier<String> sc) {
		int N = Integer.parseInt(sc.get());
		var A = new int[N];
		Arrays.setAll(A, $ -> Integer.parseInt(sc.get()));

		if (isPairwise(A)) {
			System.out.println("pairwise coprime");
			return;
		}

		if (isSetwise(A)) {
			System.out.println("setwise coprime");
			return;
		}

		System.out.println("not coprime");
	}

	int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	boolean isPairwise(int[] A) {
		int[] count = new int[1000000 + 1];
		for (int n : A) {
			for (int div = 2; (long) div * div <= (long) n; div++) {
				if (n % div == 0) {
					if (count[div] > 0 || count[n / div] > 0) {
						return false;
					}
					count[div]++;
					if (div != n / div) count[n / div]++;
				}
			}
			if (n != 1) {
				if (count[n] > 0) return false;
				count[n]++;
			}
		}
		return true;
	}

	boolean isSetwise(int[] A){
		int gcd = A[0];
		for (int i = 1; i < A.length; i++) {
			gcd = gcd(gcd, A[i]);
		}
		return gcd == 1;
	}
}

class Main {
	public static void main(String... args) {
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		var reader = new BufferedReader(new InputStreamReader(System.in));
		new Solver().solve(new Supplier<>() {
			StringTokenizer line;

			public String get() {
				while (line == null || !line.hasMoreTokens()) try {
					line = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
				return line.nextToken();
			}
		});
		System.out.flush();
	}
}