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.*;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

    int N = Integer.parseInt(in.readLine());
    int[] A = new int[N];
    StringTokenizer st = new StringTokenizer(in.readLine());
    for (int i = 0; i < N; ++i) {
      A[i] = Integer.parseInt(st.nextToken());
    }

    System.out.println(solve(N, A));

    in.close();
  }

  private static String solve(int N, int[] A) {
    boolean pc = true;
    Set<Integer> primes = factorize(A[0]);

    for (int i = 1; i < N && pc; ++i) {
      Set<Integer> factors = factorize(A[i]);
      for (int factor : factors) {
        if (primes.contains(factor)) {
          pc = false;
          break;
        }
      }
      primes.addAll(factors);
    }

    if (pc) {
      return "pairwise coprime";
    }

    long lastGcd = A[0];
    for (int i = 1; i < N; ++i) {
      lastGcd = gcd(lastGcd, A[i]); 
    }
    
    if (lastGcd == 1) {
      return "setwise coprime";
    }

    return "not coprime";
  }

  private static Set<Integer> factorize(int x) {
    Set<Integer> factors = new HashSet<>();
  
    int y = x;
    for (int i = 2; i * i <= y; ++i) {
      if (x % i == 0) {
        while (x % i == 0) {
          x /= i;
        }
        factors.add(i);
      } 
    }
    
    if (x > 1) {
      factors.add(x);
    }

    return factors;
  }

  private static long gcd(long a, long b) {
    if (b == 0) {
      return a;
    }

    return gcd(b, a % b);
  }
}