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.BufferedInputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created by Harry on 5/10/20.
 */
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(new BufferedInputStream(System.in));
        int n = scanner.nextInt();
        int[] nums = new int[n];
        for(int i=0; i<n; i++){
            nums[i] = scanner.nextInt();
        }
        Set<Integer> set = new HashSet<>();
        boolean isPair = true;
        boolean isSet = false;
        int gcd = nums[0];
        for(int i=0; i<n; i++){
            if(!isSet){
                gcd = gcd(gcd, nums[i]);
                if(gcd==1){
                    isSet = true;
                }
            }
            if(isPair){
                for(int j=1; j*j<=nums[i]; j++){
                    if(nums[i]%j==0){
                        int o = nums[i]/j;
                        if(j!=1 && set.contains(j)){
                            isPair = false;
                            break;
                        }
                        if(o!=1 && set.contains(o)){
                            isPair = false;
                            break;
                        }
                        if(j!=1) set.add(j);
                        if(o!=1) set.add(o);
                    }
                }
            }
        }

        if(isPair){
            System.out.println("pairwise coprime");
        }
        else if(isSet){
            System.out.println("setwise coprime");
        }
        else{
            System.out.println("not coprime");
        }
    }

    private static int gcd(int a, int b){
        int min = Math.min(a, b);
        int max = Math.max(a, b);
        if(min==0){
            return max;
        }
        return gcd(max%min, min);
    }
}
