package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func main() {
	var n int
	fmt.Scan(&n)
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	as := make([]int, n)
	for i := range as {
		sc.Scan()
		as[i], _ = strconv.Atoi(sc.Text())
	}
	pw := true
	pm := make(map[int]bool)
	sm := make(map[int]bool)
	{
		m := prime(as[0])
		for k, _ := range m {
			sm[k] = true
		}
	}

	for i := range as {
		m := prime(as[i])
		for k, _ := range m {
			if _, ok := pm[k]; ok {
				pw = false
			}
			pm[k] = true
		}
		for k, v := range sm {
			if !v {
				continue
			}
			if _, ok := m[k]; !ok {
				sm[k] = false
			}
		}
	}

	sw := true
	for _, v := range sm {
		if v {
			sw = false
		}
	}

	if pw {
		fmt.Println("pairwise coprime")
	} else if sw {
		fmt.Println("setwise coprime")
	} else {
		fmt.Println("not coprime")
	}
}

func prime(a int) map[int]int {
	m := make(map[int]int)
	ok := true
	for ok {
		ok = false
		for i := 2; i <= sqrt(a); i++ {
			if a%i == 0 {
				a /= i
				m[i]++
				ok = true
				break
			}
		}
	}
	if a > 1 {
		m[a]++
	}
	return m
}

func sqrt(a int) int {
	return int(math.Sqrt(float64(a)))
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
