jiahuimbzuai/CoQuIR huggingface dataset:
//  [javascript]
const SieveOfEratosthenes = (n) => {
    let flg = (new Array(n)).fill(0)/* set flg[i] to true when it is seived */
    let primes = []/* list of prime numbers */
    for(let i=2; i*i<=n; i++) {
        if(!flg[i]) {
            primes.push(i)
            for(let j=i; j*j<=n; j+=i) {
                flg[j] = 1
            }
        }
    }
    return primes
}

const factorizationBySoE = (n, primes) => {
    //const primes = SieveOfEratosthenes(n)
    let factors = {}
    primes.some(p => {
        if(n < p) return true
        while(n%p===0) {
            if(!factors[p])factors[p]=1
            else factors[p]++
            n/=p
        }
    })
    if(n>1)factors[n]=1
    return factors
}


const getGCD = (a,b) => {
    if(b===0)return a
    else if(a===0)return b
    return getGCD(b, a%b)
}

const main = (arg) => {
    const N = Number(arg.split("\n")[0])
    const a = arg.split("\n")[1].split(" ").map(Number)
    
    const MAX_A = 10**6+100
  //  const A = Math.max(...a)
    
    //  check if p is in {a} (paircoprime)
    //const primes = SieveOfEratosthenes(A)
//    return
    let set = [...new Array(MAX_A)].fill(0)
    isPairCoprime = true
  /*
    for(let i=0; i<N; i++) {
        const factors = Object.keys(factorizationBySoE(a[i], primes))
        for(let j=0; j<factors.length; j++ ) {
            // console.log(`i=${i}, j=${j}, ${factors[j]}`)
            // console.log(factors)
            if(set[factors[j]] === 1) {
                isPairCoprime = false
            }
            set[factors[j]] = 1
        }
    }
*/
//  return
    for(let i=0; i<N; i++) {
        set[a[i]]++
    }
//  return
    for(let i=2; i<MAX_A; i++) {
         let cnt=0
         for(let j=i; j<MAX_A; j+=i) {
             cnt+=set[j]
         }
        if(cnt>1) {
             isPairCoprime = false
         }
     }
    
    if(isPairCoprime) {
        console.log("pairwise coprime")
        return
    }
     // return
    // setcoprime
    // let gcd = getGCD(a[0], a[1])
    let gcd = 0
    for(let i=0; i<a.length; i++) {
        gcd = getGCD(gcd, a[i])
        // console.log(gcd)
    }
    
    if(gcd===1) {
        console.log("setwise coprime")
        return
    }
    
    console.log("not coprime")
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const factorization = (n) => {
    let primes = []
    for(let i=2; i*i<=n; i++) {
        let e=0
        while(n%i===0) {
            e++
            n/=i
        }
        if(e) {
            primes.push(i)
        }
    }
    if(n>1) {
        primes.push(n)
    }
    return primes
}

const getGCD = (a,b) => {
    if(b===0)return a
    else if(a===0)return b
    return getGCD(b, a%b)
}

const main = (arg) => {
    const N = Number(arg.split("\n")[0])
    const a = arg.split("\n")[1].split(" ").map(Number)
    
    const MAX_A = 10**6+1
    
    //  check if p is in {a} (paircoprime)
    const primes = SieveOfEratosthenes(MAX_A)
    let set = [...new Array(MAX_A)].fill(0)
    isPairCoprime = true
    for(let i=0; i<N; i++) {
        //const factors = Object.keys(factorizationBySoE(a[i], primes))
  	    const factors = factorization(a[i])
  	    console.log(`${a[i]}`)
  	    console.log(factors)
        for(let j=0; j<factors.length; j++ ) {
            if(set[factors[j]] === 1) {
                isPairCoprime = false
            }
            set[factors[j]] = 1
        }
    }

  	if(isPairCoprime) {
        console.log("pairwise coprime")
        return
    }

  // setcoprime
    let gcd = 0
    for(let i=0; i<a.length; i++) {
        gcd = getGCD(gcd, a[i])
    }
    
    if(gcd===1) {
        console.log("setwise coprime")
        return
    }
    
    console.log("not coprime")
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const SieveOfEratosthenes = (n) => {
    let flg = (new Array(n)).fill(0)/* set flg[i] to true when it is seived */
    let primes = []/* list of prime numbers */
    for(let i=2; i*i<=n; i++) {
        if(!flg[i]) {
            primes.push(i)
            for(let j=i; j*j<=n; j+=i) {
                flg[j] = 1
            }
        }
    }
    return primes
}

const factorization = (n) => {
    let primes = []
    for(let i=2; i*i<=n; i++) {
        let e=0
        while(n%i===0) {
            e++
            n/=i
        }
        if(e) {
            primes.push({i,e})
        }
    }
    return primes
}

const factorizationBySoE = (n, primes) => {
    //const primes = SieveOfEratosthenes(n)
    let factors = {}
    primes.some(p => {
        if(n < p) return true
        while(n%p===0) {
            if(!factors[p])factors[p]=1
            else factors[p]++
            n/=p
        }
    })
    if(n>1)factors[n]=1
    return factors
}


const getGCD = (a,b) => {
    if(b===0)return a
    else if(a===0)return b
    return getGCD(b, a%b)
}

const main = (arg) => {
    const N = Number(arg.split("\n")[0])
    const a = arg.split("\n")[1].split(" ").map(Number)
    
    const MAX_A = 10**6+1
    
    //  check if p is in {a} (paircoprime)
    const primes = SieveOfEratosthenes(MAX_A)
    let set = [...new Array(MAX_A)].fill(0)
    isPairCoprime = true
    for(let i=0; i<N; i++) {
        //const factors = Object.keys(factorizationBySoE(a[i], primes))
  	    const factors = factorization(a[i])
        for(let j=0; j<factors.length; j++ ) {
            if(set[factors[j]] === 1) {
                isPairCoprime = false
            }
            set[factors[j]] = 1
        }
    }

  	if(isPairCoprime) {
        console.log("pairwise coprime")
        return
    }

  // setcoprime
    let gcd = 0
    for(let i=0; i<a.length; i++) {
        gcd = getGCD(gcd, a[i])
    }
    
    if(gcd===1) {
        console.log("setwise coprime")
        return
    }
    
    console.log("not coprime")
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const SieveOfEratosthenes = (n) => {
    let flg = (new Array(n)).fill(0)/* set flg[i] to true when it is seived */
    let primes = []/* list of prime numbers */
    for(let i=2; i*i<=n; i++) {
        if(!flg[i]) {
            primes.push(i)
            for(let j=i; j*j<=n; j+=i) {
                flg[j] = 1
            }
        }
    }
    return primes
}

const factorizationBySoE = (n, primes) => {
    //const primes = SieveOfEratosthenes(n)
    let factors = {}
    primes.some(p => {
        if(n < p) return true
        if(n%p===0)factors[p]=1
    })
    // primes.some(p => {
    //     if(n < p) return true
    //     while(n%p===0) {
    //         if(!factors[p])factors[p]=1
    //         else factors[p]++
    //         n/=p
    //     }
    // })
    if(n>1)factors[n]=1
    return factors
}


const getGCD = (a,b) => {
    if(b===0)return a
    else if(a===0)return b
    return getGCD(b, a%b)
}

const main = (arg) => {
    const N = Number(arg.split("\n")[0])
    const a = arg.split("\n")[1].split(" ").map(Number)
    
    const MAX_A = 10**6+1

    //  check if p is in {a} (paircoprime)
    const primes = SieveOfEratosthenes(MAX_A)
    let set = [...new Array(MAX_A)].fill(0)
    isPairCoprime = true
    for(let i=0; i<N; i++) {
        const factors = Object.keys(factorizationBySoE(a[i], primes))
        for(let j=0; j<factors.length; j++ ) {
            // console.log(`i=${i}, j=${j}, ${factors[j]}`)
            // console.log(factors)
            if(set[factors[j]] === 1) {
                isPairCoprime = false
            }
            set[factors[j]] = 1
        }
    }
    
    // for(let i=0; i<MAX_A; i++) {
    //     set[a[i]] = 1
    // }
    // for(let i=2; i<MAX_A; i++) {
    //     let cnt=0
    //     for(let j=i; j<MAX_A; j+=i) {
    //         cnt+=set[j]
    //     }
    //     if(cnt>1) {
    //         isPairCoprime = false
    //     }
    // }
    
    if(isPairCoprime) {
        console.log("pairwise coprime")
        return
    }
    
    // setcoprime
    let gcd = 0
    for(let i=0; i<a.length; i++) {
        gcd = getGCD(gcd, a[i])
    }
    
    if(gcd===1) {
        console.log("setwise coprime")
        return
    }
    
    console.log("not coprime")
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

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

func main() {
	sc := NewScanner()

	const MaxA = 1_000_000

	n := sc.ReadInt()
	uniqueN := n
	isPairwise := true
	aHas := make([]bool, MaxA+1)
	for i := 0; i < n; i++ {
		ai := sc.ReadInt()
		if aHas[ai] {
			// dup
			uniqueN--
			if ai > 1 {
				isPairwise = false
			}
		} else {
			aHas[ai] = true
		}
	}

	sieve := make([]bool, MaxA+1)
	for i := 2; i <= MaxA/2; i++ {
		if sieve[i] {
			continue
		}

		count := 0
		for j := i; j <= MaxA; j += i {
			sieve[j] = true
			if aHas[j] {
				count++
			}
		}

		if count > 1 {
			isPairwise = false
		}
		if count >= uniqueN {
			fmt.Println("not coprime")
			return
		}
	}

	if isPairwise {
		fmt.Println("pairwise coprime")
	} else {
		fmt.Println("setwise coprime")
	}
}

// from [my library](https://github.com/ikngtty/go-contestlib)
// -   math/simple

func Abs(x int) int {
	if x >= 0 {
		return x
	}
	return -x
}

func Min(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}

	min := values[0]
	for _, v := range values {
		if v < min {
			min = v
		}
	}
	return min
}

func Max(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}

	max := values[0]
	for _, v := range values {
		if v > max {
			max = v
		}
	}
	return max
}

func Pow(base, exponent int) int {
	if exponent < 0 {
		panic(fmt.Sprintf("exponent (%d) should not be a minus", exponent))
	}

	answer := 1
	for i := 0; i < exponent; i++ {
		answer *= base
	}
	return answer
}

func Ceil(divident, dividor int) int {
	if dividor == 0 {
		panic("dividor should not be 0")
	}

	quo := divident / dividor
	rem := divident % dividor

	if rem != 0 {
		if (divident > 0 && dividor > 0) ||
			(divident < 0 && dividor < 0) {
			return quo + 1
		}
	}
	return quo
}

// -   sortutil

func ReverseInts(a []int) {
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
}

func ReverseStrings(a []string) {
	sort.Sort(sort.Reverse(sort.StringSlice(a)))
}

// -   io

type Scanner struct {
	bufScanner *bufio.Scanner
}

func NewScanner() *Scanner {
	bufSc := bufio.NewScanner(os.Stdin)
	bufSc.Split(bufio.ScanWords)
	bufSc.Buffer(nil, 100000000)
	return &Scanner{bufSc}
}

func (sc *Scanner) ReadString() string {
	bufSc := sc.bufScanner
	bufSc.Scan()
	return bufSc.Text()
}

func (sc *Scanner) ReadInt() int {
	bufSc := sc.bufScanner
	bufSc.Scan()
	text := bufSc.Text()

	num, err := strconv.Atoi(text)
	if err != nil {
		panic(err)
	}
	return num
}

func (sc *Scanner) ReadFloat() float64 {
	bufSc := sc.bufScanner
	bufSc.Scan()
	text := bufSc.Text()

	num, err := strconv.ParseFloat(text, 64)
	if err != nil {
		panic(err)
	}
	return num
}
//  [go]
package main

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

func main() {
	scan_init()
	n := scanInt()
	a := make([]int, n)
	max := 0
	for i:= 0; i<n; i++ {
		a[i] = scanInt()
		if max < a[i] {
			max = a[i]
		}
	}
	if boolSosu(a, max) {
		fmt.Println("pairwise coprime")
	} else {
		g := 0
		for i:= 0; i<n;i ++ {
			g = gcd(g,a[i])
		}
		if g == 1 {
			fmt.Println("setwise coprime")
		} else {
			fmt.Println("not coprime")
		}
	}
}
	func gcd(a int, b int) int {
		// aの方が小さくなるように設定する
		// ユークリッドの互除法で最大公約数を出す
		if a>b {
			//swap
			tmp := a
			a = b
			b = tmp
		}
		if a == 0 {
			return b
		}
		r := b % a
		if r != 0 {
			return gcd(r,a)
		} else {
			return a
		}
	}
	func allSosu(max int) map[int]bool{
		// max値までの素数群を返す
		// 計算量logmax*logmax
		output := map[int]bool{}
		furui := make([]int, max+1)
		for i:= 2; i*i<=max; i++ {
			if furui[i] > 0 {
				continue
			}
			for j:=i+i; j<=max; j += i{
				furui[j]++
			}
		}
		for i:=2; i<=max; i++ {
			if furui[i] == 0 {
				output[i] = true
			}
		}
		return output
	}
	func boolSosu(list []int, max int) bool {
			// 与えられた群がすべての要素に対し互いに素の時trueを返す
			furui := make([]int, max+1)
			for i:= 0;i<len(list); i++ {
				furui[list[i]]++
			}
			for i:=2; i<max; i++ {
				cnt := 0
				for j:=i; j<=max; j+= i {
					cnt += furui[j]
				}
				if cnt>1 {
					return false
				}
			}
			return true
		}
var sc = bufio.NewScanner(os.Stdin)

func scan_init() {
	sc.Split(bufio.ScanWords)
}
func scanInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func scan() string {
	sc.Scan()
	return sc.Text()
}

var rdr = bufio.NewReaderSize(os.Stdin, 200000)

func readLine() string {
	buf := make([]byte, 0, 200000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
func readLineToNumber() int {
	S := readLine()
	number, _ := strconv.Atoi(S)
	return number
}
func readLineToSlice() []string {
	S := readLine()
	list := strings.Split(S, "")
	return list
}
func readLineToNumberSlice(memo map[string]int) []int {
	// err時は-1を代入
	S := readLine()
	intList := make([]int, len(S))
	for i := 0; i < len(S); i++ {
		if val, ok := memo[string(S[i])]; ok {
			intList[i] = val
		} else {
			intList[i] = -1
		}
	}
	return intList
}
//  [go]
package main

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

var scanner = bufio.NewScanner(os.Stdin)

func NextStr() string {
	scanner.Scan()
	return scanner.Text()
}

func NextInt() int {
	i, _ := strconv.Atoi(NextStr())
	return i
}

func Gcd(x, y int) int {
	if x < y {
		x, y = y, x
	}
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

func SqrtInt(x int) float64 {
	float_x := float64(x)
	return math.Sqrt(float_x)
}

func Sieve(n int) []int {
	var isPrime [2000000 + 5 + 1]bool
	D := make([]int, 2000000+5+1)
	for i := 0; i < len(D); i++ {
		D[i] = i
	}

	for i := 0; i <= n; i++ {
		isPrime[i] = true
	}

	isPrime[0] = false
	isPrime[1] = false

	for i := 2; i <= n; i++ {
		if isPrime[i] {

			for j := 2 * i; j <= n; j += i {
				isPrime[j] = false
				D[j] = i
			}
		}
	}
	return D
}

func Contains(n int, A []int) bool {
	for _, e := range A {
		if n == e {
			return true
		}
	}
	return false
}

const MaxA = 1000001

func main() {
	scanner.Split(bufio.ScanWords)
	D := Sieve(MaxA)

	n := NextInt()
	res := NextInt()

	var used [MaxA]bool
	for i := 0; i < MaxA; i++ {
		used[i] = false
	}

	isPC := true

	m := res
	for m > 1 {
		prime := D[m]
		for D[m] == prime {
			used[m] = true
			m /= prime
		}
	}

	for i := 0; i < n-1; i++ {
		Ai := NextInt()
		res = Gcd(res, Ai)
		m := Ai
		for m > 1 {
			prime := D[m]
			if used[m] {
				isPC = false
			}
			for D[m] == prime {
				m /= prime
				used[m] = true
			}

		}
	}

	var ans string
	if res != 1 {
		ans = "not coprime"
	} else if isPC {
		ans = "pairwise coprime"
	} else {
		ans = "setwise coprime"
	}

	fmt.Println(ans)
}
//  [go]
package main

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

var scanner = bufio.NewScanner(os.Stdin)

func NextStr() string {
	scanner.Scan()
	return scanner.Text()
}

func NextInt() int {
	i, _ := strconv.Atoi(NextStr())
	return i
}

func Gcd(x, y int) int {
	if x < y {
		x, y = y, x
	}
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

func SqrtInt(x int) float64 {
	float_x := float64(x)
	return math.Sqrt(float_x)
}

func Sieve(n int) []int {
	var isPrime [2000000 + 5 + 1]bool
	D := make([]int, 2000000+5+1)
	for i := 0; i < len(D); i++ {
		D[i] = i
	}

	for i := 0; i <= n; i++ {
		isPrime[i] = true
	}

	isPrime[0] = false
	isPrime[1] = false

	for i := 2; i <= n; i++ {
		if isPrime[i] {

			for j := 2 * i; j <= n; j += i {
				isPrime[j] = false
				D[j] = i
			}
		}
	}
	return D
}

func Contains(n int, A []int) bool {
	for _, e := range A {
		if n == e {
			return true
		}
	}
	return false
}

const MaxA = 1000000

func main() {
	scanner.Split(bufio.ScanWords)
	D := Sieve(MaxA)

	n := NextInt()
	res := NextInt()

	var used [MaxA]bool
	for i := 0; i < MaxA; i++ {
		used[i] = false
	}

	isPC := true

	m := res
	for m > 1 {
		prime := D[m]
		for D[m] == prime {
			used[m] = true
			m /= prime
		}
	}

	for i := 0; i < n-1; i++ {
		Ai := NextInt()
		res = Gcd(res, Ai)
		m := Ai
		for m > 1 {
			prime := D[m]
			if used[m] {
				isPC = false
			}
			for D[m] == prime {
				m /= prime
				used[m] = true
			}

		}
	}

	var ans string
	if res != 1 {
		ans = "not coprime"
	} else if isPC {
		ans = "pairwise coprime"
	} else {
		ans = "setwise coprime"
	}

	fmt.Println(ans)
}
//  [go]
package main

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

var scanner = bufio.NewScanner(os.Stdin)

func NextStr() string {
	scanner.Scan()
	return scanner.Text()
}

func NextInt() int {
	i, _ := strconv.Atoi(NextStr())
	return i
}

func Gcd(x, y int) int {
	if x < y {
		x, y = y, x
	}
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

func SqrtInt(x int) float64 {
	float_x := float64(x)
	return math.Sqrt(float_x)
}

func Sieve(n int) []int {
	var isPrime [2000000 + 5 + 1]bool
	D := make([]int, 2000000+5+1)
	for i := 0; i < len(D); i++ {
		D[i] = i
	}

	for i := 0; i <= n; i++ {
		isPrime[i] = true
	}

	isPrime[0] = false
	isPrime[1] = false

	for i := 2; i <= n; i++ {
		if isPrime[i] {

			for j := 2 * i; j <= n; j += i {
				isPrime[j] = false
				D[j] = i
			}
		}
	}
	return D
}

func PrimeFactorization(n int, D []int) []int {
	var primes []int
	for n > 1 {
		prime := D[n]
		primes = append(primes, prime)
		for D[n] == prime {
			n /= prime
		}
	}
	return primes
}

func Contains(n int, A []int) bool {
	for _, e := range A {
		if n == e {
			return true
		}
	}
	return false
}

const MaxA = 1000000

func main() {

	scanner.Split(bufio.ScanWords)
	D := Sieve(MaxA)

	n := NextInt()
	res := NextInt()

	var AllPrimes []int
	var PrimesCount int
	primes := PrimeFactorization(res, D)
	AllPrimes = append(AllPrimes, primes...)
	PrimesCount += len(primes)

	for i := 0; i < n-1; i++ {
		Ai := NextInt()
		res = Gcd(res, Ai)
		primes := PrimeFactorization(Ai, D)
		PrimesCount += len(primes)
		for _, p := range primes {
			if !Contains(p, AllPrimes) {
				AllPrimes = append(AllPrimes, p)
			}
		}
	}

	var ans string
	if res != 1 {
		ans = "not coprime"
	} else if len(AllPrimes) == PrimesCount {
		ans = "pairwise coprime"
	} else {
		ans = "setwise coprime"
	}

	fmt.Println(ans)
}
//  [ruby]
END { load __FILE__ unless $stdin.eof? }

require 'prime'

n = gets.to_i
a = gets.split.map!(&:to_i)
b = a.dup

result = true
while b.size > 1
  b = b.each_slice(2).map do |s, t|
    t ||= 1
    break if s.gcd(t) != 1
    s * t
  end

  unless b
    result = false
    break
  end
end

if result
  puts "pairwise coprime"
elsif a.inject(0, :gcd) == 1
  puts "setwise coprime"
else
  puts "not coprime"
end
//  [ruby]
# frozen_string_literal: true

require 'prime'

n = gets.to_i
a = gets.split.map(&:to_i)

@p = {}

@primes = Prime.each(Math.sqrt(a.max)).to_a

def prime_division(n)
  return @p[n] if @p[n]
  return @p[n] = [n] if n.prime?

  divs = []
  @primes.each do |p|
    break if n == 1

    if n.prime?
      divs.push n
      break
    end
    if (n % p).zero?
      divs.push p
      n /= p while (n % p).zero?
    end
  end
  @p[n] = divs
end

b = Array.new(n + 1, false)
flag = true
a.each do |e|
  prime_division(e).each do |p|
    if b[p]
      flag = false
      break
    end
    b[p] = true
  end
  break unless flag
end

if flag
  puts 'pairwise coprime'
  exit
end

g = a[0]
(1..(n - 1)).each do |i|
  g = g.gcd(a[i])
end

if g == 1
  puts 'setwise coprime'
else
  puts 'not coprime'
end
//  [ruby]
# frozen_string_literal: true

require 'prime'

n = gets.to_i
a = gets.split.map(&:to_i)

@p = {}

@primes = Prime.each(Math.sqrt(a.max)).to_a

def prime_division(n)
  return @p[n] if @p[n]
  return @p[n] = [n] if n.prime?

  divs = []
  @primes.each do |p|
    break if n == 1

    if n.prime?
      divs.push n
      break
    end
    while (n % p).zero?
      divs.push p
      n /= p
    end
  end
  @p[n] = divs
end

b = Array.new(n + 1, false)
flag = true
a.each do |e|
  prime_division(e).uniq.each do |p|
    if b[p]
      flag = false
      break
    end
    b[p] = true
  end
  break unless flag
end

if flag
  puts 'pairwise coprime'
  exit
end

g = a[0]
(1..(n - 1)).each do |i|
  g = g.gcd(a[i])
end

if g == 1
  puts 'setwise coprime'
else
  puts 'not coprime'
end
//  [ruby]
n = $stdin.readline.to_i
a = $stdin.readline.chomp.split.map(&:to_i)
m = 10 ** 6
d = Array.new(m + 1)

2.step(m) do |i|
  next if !d[i].nil?
  
  d[i] = i
  (m / i).times do |j|
    k = (j + 1) * i
    next if !d[k].nil?
    d[k] = i
  end
end

g = a[0]
pc = true
h = Hash.new(true)
n.times do |i|
  g = g.gcd(a[i])
  x = a[i]
  q = []
  while pc && x > 1
    if h[d[x]]
      pc = false
      break
    end

    q << d[x]
    x /= d[x]
  end

  q.uniq.each do |y|
    h[y] = true
  end
end

if pc
  puts "pairwise coprime"
elsif g == 1
  puts "setwise coprime"
else
  puts "not coprime"
end
//  [ruby]
n = $stdin.readline.to_i
a = $stdin.readline.chomp.split.map(&:to_i)
m = 10 ** 6
d = Array.new(m + 1)

2.step(m) do |i|
  next if !d[i].nil?
  
  d[i] = i
  (m / i).times do |j|
    k = (j + 1) * i
    next if !d[k].nil?
    d[k] = i
  end
end

g = a[0]
pc = true
h = Hash.new(0)
n.times do |i|
  g = g.gcd(a[i])
  x = a[i]
  q = []
  while pc && x > 1
    if h[d[x]] > i + 1
      pc = false
      break
    end

    q << d[x]
    x /= d[x]
  end
  q.uniq.each do |y|
    h[y] += 1
  end
end

if pc
  puts "pairwise coprime"
elsif g == 1
  puts "setwise coprime"
else
  puts "not coprime"
end
//  [rust]
#[allow(unused_imports)]
use {
    proconio::{fastout, input, marker::*},
    std::cmp::*,
    std::collections::*,
    std::ops::*,
};

fn gcd(a: usize, b: usize) -> usize {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}

#[fastout]
fn main() {
    input! {
        n: usize,
        a: [usize; n]
    }
    let mut x = a[0];
    for &a in a.iter() {
        x = gcd(x, a);
        if x == 1 {
            break;
        }
    }

    if x != 1 {
        println!("not coprime");
        return;
    }

    let m = *a.iter().max().unwrap();
    let mut exist = vec![false; m + 1];
    for &a in a.iter() {
        if exist[a] && a != 1 {
            println!("setwise coprime");
            return;
        }
        exist[a] = true;
    }

    let mut yet = vec![true; m + 1];
    for i in 2..=m {
        if !yet[i] {
            continue;
        }
        let mut count = 0;
        for j in 1..=m / i {
            yet[i * j] = false;
            if exist[i * j] {
                count += 1;
                if count == 2 {
                    println!("setwise coprime");
                    return;
                }
            }
        }
    }
    println!("pairwise coprime");
}
//  [rust]
#![allow(
  non_snake_case,
  unused_variables,
  unused_assignments,
  unused_mut,
  unused_imports,
  unused_macros,
  dead_code
)]
use proconio::fastout;
use proconio::input;
use proconio::marker::*;
use std::cmp::*;
use std::collections::*;
//use std::collections::VecDeque;
macro_rules! debug {
  ($($a:expr),* $(,)*) => {
      #[cfg(debug_assertions)]
      eprintln!(concat!($("| ", stringify!($a), "={:?} "),*, "|"), $(&$a),*);
  };
}
#[fastout]
fn main() {
  input! {
    N:usize,
    A:[usize;N]
  }
  let N: usize = N;
  let mut nmax = 1000_000usize;
  let mut h = vec![0usize; nmax + 1];
  for i in 0..N {
    h[A[i]] += 1;
  }
  let mut mx = 0;
  let mut isprime = vec![true; nmax + 1];
  let mut i = 2;
  let mut j = 0;
  let mut f = 0;
  while i <= 1000 {
    if isprime[i] {
      j = i * 2;
      while j <= nmax {
        isprime[j] = false;
        j += i;
      }
    }
    i += 1;
  }
  for i in 2..=nmax {
    if isprime[i] {
      f = 0usize;
      j = i;
      while j <= nmax {
        f += h[j];
        j += i;
      }
      mx = max(mx, f);
    }
  }
  if mx <= 1 {
    println!("pairwise coprime");
    return;
  } else if mx < N {
    println!("setwise coprime");
  } else {
    println!("not coprime")
  }
}
//  [rust]
use proconio::input;
extern crate num_integer;

fn usqrt(x: u32) -> u32 {
    (x as f64).sqrt().floor() as u32
}

fn main() {
    input! {
        n: usize,
        a: [u32;n],
    };
    let maxa = *a.iter().max().unwrap();
    let maxp = usqrt(maxa);
    let mut b = Vec::new();
    let mut ps = Vec::new();
    b.push(0);
    b.push(1);
    for i in 2..=maxa {
        let mut x = i;
        for &p in ps.iter() {
            if i % p == 0 {
                x = p;
                break;
            }
        }
        if x == i && x <= maxp {
            ps.push(x);
        }
        b.push(x);
    }
    let mut f = vec![vec![]; n];
    for i in 0..n {
        let mut t = a[i];
        while t != 1 {
            let d = b[t as usize];
            f[i].push(d);
            t /= d;
        }
    }
    let mut pairwise = true;
    for &p in ps.iter() {
        let mut cnt = false;
        for fs in f.iter() {
            if fs.iter().filter(|&&x| p == x).count() >= 1 {
                if cnt {
                    pairwise = false;
                    break;
                } else {
                    cnt = true;
                }
            }
        }
        if !pairwise {
            break;
        }
    }
    if pairwise {
        println!("pairwise coprime");
        return;
    }
    let mut setwise = false;
    let mut g = a[0];
    for i in 1..n {
        g = num_integer::gcd(g, a[i]);
        if g == 1 {
            setwise = true;
            break;
        }
    }
    if setwise {
        println!("setwise coprime");
    } else {
        println!("not coprime");
    }
}
//  [rust]
use proconio::input;

fn main() {
    input!(n: usize, a: [usize; n]);

    const AMAX: usize = 1_000_000;

    let mut cnt = vec![0; AMAX + 1];
    for &a in &a {
        cnt[a] += 1;
    }

    let mut seen = vec![false; AMAX + 1];
    let mut max_csum = 0;
    for i in 2..=AMAX {
        if seen[i] {
            continue;
        }
        let mut csum = 0;
        for j in 1..AMAX / i {
            seen[i * j] = true;
            csum += cnt[i * j];
        }
        max_csum = max_csum.max(csum);
    }

    let pairwise = max_csum <= 1;
    let setwise = max_csum < n;

    println!(
        "{}",
        if pairwise {
            "pairwise coprime"
        } else if setwise {
            "setwise coprime"
        } else {
            "not coprime"
        }
    );
}
//  [rust]
use proconio::input;

fn main() {
    input!(n: usize, a: [usize; n]);

    const AMAX: usize = 1_000_000;

    let mut div = vec![0; AMAX + 1];
    for i in 2..=AMAX {
        if div[i] == 0 {
            div[i] = i;
        }
        let j = i + div[i];
        if j <= AMAX && div[j] == 0 {
            div[j] = div[i];
        }
    }

    let mut cnt = vec![0; AMAX + 1];
    for &a in &a {
        cnt[a] += 1;
    }
    for i in (2..=AMAX).rev() {
        if div[i] == i {
            continue;
        }
        let j = i / div[i];
        cnt[j] += cnt[i];
        if div[j] != div[i] {
            cnt[div[i]] += cnt[i];
        }
    }

    let primes = (2..=AMAX).filter(|&i| div[i] == i);
    let pairwise = primes.clone().all(|i| cnt[i] <= 1);
    let setwise = primes.clone().all(|i| cnt[i] < n);

    println!(
        "{}",
        if pairwise {
            "pairwise coprime"
        } else if setwise {
            "setwise coprime"
        } else {
            "not coprime"
        }
    );
}
//  [python]
moji = input()
if moji.isupper():
    print('A')
else:
    print('a')
//  [python]
a = input()

if a.isupper() == True:
  print('A')
elif a.islower() == True:
  print('a')
//  [python]
a = input()
if a.isupper():
  print('A')
else:
  print('a')
//  [python]
m = input()
x=ord(m)
if x >= 97 and x <= 122:
    print("a")
else:
    print("A"
//  [python]
m = input()
if m == "A" or m == "B" or m == "Q" or m == "W" or m == "E" or m == "R" or m == "T" or m == "Y" or m == "U" or m == "I" or m == "O" or m == "P" or m == "S" or m == "D" or m == "F" or m == "G" or m == "H" or m == "J" or m == "K" or m == "L" or m == "Z" or m == "X" or m == "C" or m == "V" or m == "B" or m == "N" or m == "M":
    print("A")
if m == "a" or m == "b" or m == "q" or m == "w" or m == "e" or m == "r" or m == "t" or m == "y" or m == "u" or m == "i" or m == "o" or m == "p" or m == "s" or m == "d" or m == "f" or m == "g" or m == "h" or m == "j" or m == "k" or m == "l" or m == "Z" or m == "x" or m == "c" or m == "v" or m == "b" or m == "n" or m == "m":
    print("a")
//  [python]
m = input()
if m == "A":
    print("A")
if m == "a":
    print("a")
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String a = br.readLine();
        System.out.println(problem171a(a));
    }

    private static String problem171a(String a) {
        return (a.equals(a.toLowerCase())) ? "a" : "A";
    }
}
//  [java]

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
import java.util.TreeSet;

public class Practice {

	public static void main(String[] args) {

		Scanner inScanner = new Scanner(System.in);

	 
		String worString = inScanner.next();
		char d = worString.charAt(0);
		if (Character.isUpperCase(d)) {
			System.out.println("A");
		}else {
			System.out.println("a");
		}
		
	}
}
//  [java]
public class Main {
 	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	char c = sc.next();
    	if (Character.isUpperCase()) System.out.println('A');
        else System.out.println('a');
    }
}
//  [java]
import java.util.*;

public static class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int k=sc.nextInt();
    int[] p=new int[n;
    for(int i=0;i<n;i++){
		p[i]=sc.nextInt();
    }
    Arrays.sort(p);
	int s=0;
    for(int i=0;i<k;i++){
      s=+p[i];
    }
                    System.out.println(s);
                    }
//  [cpp]
#include <stdio.h>

int main() {
  char ch;
  scanf("%c", &ch);

  if('A' <= ch && ch <= 'Z') {
    puts("A");
  }
  else if('a' <= ch && ch <= 'z') {
    puts("a");
  }
  return 0;
}
//  [cpp]
#include<stdio.h>

int main(){
	char name;
	scanf("%c", &name);
	
	if (name >= 'A' && name <= 'Z'){
		puts( "A");
	}
	else if(name >= 'a' && name <= 'z'){
		puts("a");
	}
	return 0;
	}
//  [cpp]
#include <stdio.h>
int main ()
{
	
	char abjad;
	scanf("%c",&abjad);
	
	
	
		if(abjad >= 'A' && abjad <= 'Z')
		{
		
			printf("A");
		}
	
		else if (abjad>='a' && abjad<='z')
		{
			printf("a");
				
		}
		return 0;
}
//  [cpp]
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#include<cmath>
#include<cstdint>


     
#define INF 1e9
#define LINF 1e19
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define pb push_back
#define sz size()
     
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<ll, ll>;

     
const ll MOD = 1e9 + 7;
const ll ZER = 0;


int main(){
    char c;
    cin >> c;
    if(islower(c)){
        char res = 'A' + (c - 'a');
        cout << res << endl;
    }
    else {
        char res = 'a' + (c - 'A');
        cout << res << endl;
    }
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main(){
  char a;
  cin >> a;
  if(a == 'A' || 'B' ||'C' ||'D' ||'E' || 'F'||'G' ||'H' || 'I'||'J' ||'K' ||'L' || 'M'||'N' ||'O' ||'P' || 'Q'||'R' ||'S' ||'T' ||'U' ||'V' || 'W'|| 'X'||'Y' ||'Z')
  {cout << 'A' << endl;}
  else{cout << 'a' << endl;}
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main(){
  char a;
  cin >> a;
  if(a == 'A' || 'B' ||'C' ||'D' ||'E' || 'F'||'G' ||'H' || 'I'||'J' ||'K' ||'L' || 'M'||'N' ||'O' ||'P' || 'Q'||'R' ||'S' ||'T' ||'U' ||'V' || 'W'|| 'X'||'Y' ||'Z'||)
  {cout << 'A' << endl;}
  else{cout << 'a' << endl;}
}
//  [c]
#include <stdio.h>

int main(void) {

  char chara;

  scanf("%c", &chara);

  if((chara >= 'a') && (chara <= 'z')) {
    printf("a \n");
  }

  if((chara >= 'A') && (chara <= 'Z')) {
    printf("A \n");
  }

  return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(void)
{
    char a;
    scanf("%c", &a);
    if ('a' <= a && a <= 'z')
    {
        printf("a\n");
    }
    else
    {
        printf("A\n");
    }
    return 0;
}
//  [c]
int main(){
  char s;
  scanf("%c",&s);
  
    printf("%c",s>=97?'a':'A');
}
//  [c]
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using V = vector<int>;

int main(int argc, char const *argv[])
{
    char a; cin >> a;
    if (isupper(a)) cout << "A" << endl;
    else cout << "a" << endl;
    return 0;
}
//  [c]
#include <stdio.h>
#include <ctype.h>

int main(void){
    // Your code here!
    char c;
    scanf("%s",&c);
    
    if (isupper(c)){
        printf('A');
    }
    else{
        printf('a');
    }
}
//  [c]
#include<stdio.h>

int main(void){
	char a = 0;
	scanf("%c",&a);
	if (97 <= a&&a <= 122) {
		printf("a");
	}
	if (65<= a&&a <= 90) {
		printf("A");
	}
	 return 0;
}}
//  [javascript]

function main(lines) {
    const a = lines[0].charAt(0)

    if ('a'.charAt(0) <= a && a <= 'z'.charAt(0))
	    console.log('a')
    if ('A'.charAt(0) <= a && a <= 'Z'.charAt(0))
	    console.log('A')
}


main(require("fs").readFileSync("/dev/stdin", "utf8").split("\n"))
//  [javascript]
function main(input){
	input=input.split("\n");
var answer=input[0];
var answerA=input[0].toUpperCase();

if(answer==answerA){console.log("A")}else{console.log("a")}

}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    input = input.split("\n");
    
    const hoge = input[0];
    
    if (hoge === hoge.toUpperCase()) {
        console.log('A');
    } else {
        console.log('a');
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    const a = input;
    
    if(isUpperCase(a)){
        console.log('A');
    }else{
        console.log('a');
    }
 
}

function isUpperCase (str) {
    return str.match(/^[A-Z]+$/);
}
 
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    const a = input;
    
    if(isUpperCase(a)){
        console.log('A');
    }else{
        console.log('a');
    }
    
 
}

const isUpperCase = c => {
    return /^[A-Z]+$/g.test(c)
}
 
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

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

const (
	SCANNER_BUF_SIZE = 2 << 20

	INF = int64(math.MaxInt64)
	MOD = 1e9 + 7
)

var (
	writer  *bufio.Writer
	scanner *bufio.Scanner
)

func init() {
	writer = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, SCANNER_BUF_SIZE), SCANNER_BUF_SIZE)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func lcm(a, b int64) int64 {
	return a * b / gcd(a, b)
}

func abs(a int64) int64 {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r < a {
			a = r
		}
	}
	return a
}

func max(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r > a {
			a = r
		}
	}
	return a
}

func main() {
	defer writer.Flush()
	c := sstring()[0]
	if c >= 'A' && c <= 'Z' {
		printf("A")
	} else {
		printf("a")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	a := getStdin()
	if 'a' <= a[0] && a[0] <= 'z' {
		fmt.Printf("a\n")
	} else {
		fmt.Printf("A\n")
	}
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)

func getStdin() string {
	return readLine()
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
//  [go]
package main

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

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)

func main() {
	a := getStdin()
	if 'a' <= a[0] && a[0] <= 'z' {
		fmt.Print("a")
	} else {
		fmt.Print("A")
	}
	fmt.Printf("\n")
}

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}

func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}

func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, e := sc.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
//  [go]
package main

import (
	"fmt"
	"strings"
)

func main() {
	var a string
	fmt.Scanf("%s\n", &a)

	fmt.Println(strings.ToLower(a))
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
	"unicode"
)

type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	if err := io.writer.Flush(); err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) PrintLn(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntLn(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func (io *Io) PrintStringLn(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

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

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

func main() {
	io := NewIo()
	defer io.Flush()
	A := io.Next()
	if unicode.IsUpper(A) {
		io.PrintLn("A")
		return
	}
	io.PrintLn("a")
}
//  [ruby]
# https://atcoder.jp/contests/abc171/tasks/abc171_a

alpha = gets.chomp
cond = alpha.upcase == alpha
puts cond ? 'A' : 'a'
//  [ruby]
line = gets
puts (line == line.downcase ? 'a': 'A')
//  [ruby]
a = gets.chomp.to_s

if (a == a.upcase) then
	puts "A"
else
	puts "a"
end
//  [ruby]
n = gets.to_i

# 26進数

chars = ('a'..'z').to_a

result = ''

while n > 0
  n -= 1
  result << chars[n % 26]
  n /= 26
end

puts result.reverse
//  [ruby]
_n, k = gets.split("\s").map(&:to_i)
p = gets.split("\s").map(&:to_i)

p p.sort[0..k-1].sum
//  [ruby]
line = gets

puts (line == line.downcase ? 'a'. 'A')
//  [rust]
use std::io::*;
use std::str::FromStr;
 
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}
 
fn main() {
    let x: String = read();
    let lower_x = x.to_ascii_lowercase();
    if x != lower_x {
        println!("A");
    } else {
        println!("a");
    }
}
//  [rust]
use proconio::*;

fn main() {
    input! {
        a: char
    }

    if a >= 'A' && a <= 'Z' { println!("A"); }
    else if a >= 'a' && a <= 'z' { println!("a"); }
}
//  [rust]
use proconio::{input, fastout};

#[fastout]
fn main() {
    input!(a: char);
    if 'a'<=a && a<='z' {
        println!("a");
    } else {
        println!("A");
    }
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        n: usize,
        k: usize,
        mut p: [i32; n]
    }

    solve(k, &mut p);
}

fn solve(k: usize, p: &mut [i32]) {
    p.sort();

    let s = p.iter().take(k).sum::<i32>();
    println!("{}", s);
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        a:char
    }
    println!("{}", if a <= 'z' { 'A' } else { 'a' })
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        a:char
    }
    println!("{}", if a <= 'z' { 'A' } else { 'B' })
}
//  [swift]
let input = Character(readLine()!).unicodeScalars.first!.value - base
let base = Character("A").unicodeScalars.first!.value

if input - base < 26 {
  print("A")
} else {
  print("a")
}
//  [swift]
let a = readLine()!
if a == a.lowercased() {
  print("a")
} else {
  print("A")
}
//  [swift]
let char = readLine()!.first!
print(char.isUppercase ? "A" : "a")
//  [swift]
let a = readLine()!
print(a.range(of: "[A-Z]", options: .regularExpression) == nil ? "a" : "A")
//  [swift]
let a = readLine()!

var arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
"k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
"u", "v", "w", "x", "y", "z"]
che(chra: a)

func che(chra: String) -> Void {
    for i in arr {
        if chra == i {
            print(chra.uppercased())
            return
        }
    }
    print(a.lowercased())
}
//  [typescript]
// import std = require('tstl')

{
  type Print = void | string | number | string[] | number[];
  let outs: Print[] = [];

  const main = (): Print => {
    const r = _io();
    const [s] = r.ss();

    return 'a' <= s && s <= 'z' ? 'a' : 'A';
  };

  const _io = (i = 0) => {
    const str = require('fs').readFileSync('/dev/stdin', 'utf8');
    const lines = str.trim().split('\n');
    const s = () => lines[i++] || '';
    const n = () => Number(s());

    const mn = (v: string[]) => v.map(Number);
    const sp = (v: string) => v.split(' ');

    const ss = () => sp(s());
    const nn = () => mn(ss());
    const nls = () => mn(lines.slice(i));
    const nnls = () => lines.slice(i).map((v) => mn(sp(v)));

    return { lines, s, n, ss, nn, nls, nnls };
  };

  outs.push(main());

  console.log(
    outs
      .map((line) => (typeof line === 'object' ? line.join(' ') : String(line)))
      .join('\n')
  );
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const alpha = input[0][0];

  return alpha !== alpha.toLowerCase() ? "A" : "a";
};

console.log(main(read()));
//  [typescript]
import * as fs from "fs";
const input = fs.readFileSync("/dev/stdin", "utf8");
const re = /[A-Z]+/;
console.log(re.test(input) ? "A" : "a");
//  [typescript]
import * as fs from 'fs';

const input = fs.readFileSync("/dev/stdin", "utf8");

if (input === input.toUpperCase()) {
  console.log('A');
}
console.log('a');
//  [typescript]
import * as fs from 'fs';

const readString = (() => {
  const input = fs.readFileSync(0).toString();
  const words = input.split(/[ \n]/);
  let i = 0;
  return () => words[i++] || '';
})();
const readInt = () => parseInt(readString(), 10);
const readBigInt = () => BigInt(readString());

const gcd = (a: bigint, b: bigint) => {
  const _gcd = (a: bigint, b: bigint): bigint => {
    const q = a % b;
    return q === 0n ? b : _gcd(b, q);
  };
  return a > b ? _gcd(a, b) : _gcd(b, a);
};

const MOD = 1000000007;
const MOD_BIGINT = BigInt(MOD);
class ModBigInt {
  constructor(public v: bigint) {}

  static of(n: number | bigint) {
    return new ModBigInt(ModBigInt.toBigInt(n));
  }

  static toBigInt(other: number | bigint | ModBigInt) {
    if (typeof other === 'bigint') return other;
    if (typeof other === 'number') return BigInt(other);
    return other.v;
  }

  clone = () => new ModBigInt(this.v);
  plus = (other: number | bigint | ModBigInt) => {
    this.v = (this.v + ModBigInt.toBigInt(other)) % MOD_BIGINT;
    return this;
  };
  minus = (other: number | bigint | ModBigInt) => {
    this.v = (this.v + MOD_BIGINT - ModBigInt.toBigInt(other)) % MOD_BIGINT;
    return this;
  };
  multiply = (other: number | bigint | ModBigInt) => {
    this.v = (this.v * ModBigInt.toBigInt(other)) % MOD_BIGINT;
    return this;
  };
  pow = (other: number) => {
    const v = mod(1);
    for (let i = 0; i < other; i++) v.multiply(this.v);
    return v;
  };
}

const mod = ModBigInt.of;

const abs = (a: bigint) => (a > 0n ? a : -a);

const count = (s: number) => {
  return Math.floor(Math.sqrt(2 * s + 0.25) - 0.5);
};

(function main() {
  const A = readString();
  console.log(A.toLowerCase());
})();
//  [typescript]
// A - αlphabet
import { readFileSync } from 'fs';
const input = readFileSync('/dev/stdin', 'utf8');

const result = input === input.toUpperCase() ? 'A' : 'B';

console.log(result);
//  [python]
# -*- coding: utf-8 -*-

N = int(input())
S = input()

if S[:N//2] == S[N//2:]:
    print('Yes')
else:
    print('No')
//  [python]

N = int(input())
S = input()
ok = True
if N%2 == 1:
    ok = False
else:
    for i in range(N//2):
        if S[i] != S[i+N//2]:
            ok = False
if ok:
    print('Yes')
else:
    print('No')
//  [python]

N = int(input())
S = input()

if N%2 == 1:
    print('No')
elif S[0:N//2] == S[N//2:]:
    print('Yes')
else:
    print('No')
//  [python]
N = int(input())
S = input()
if(N % 2 == 1):
    print("No")
    exit()
for i in range(N//2):
    if(S[i] != S[i+3]):
        print("No")
        exit()
print("Yes")
//  [python]
N = int(input())
S = input()

if S[:N] == S[N:]:
    print("Yes")
else:
    print("No")
//  [python]
N = int(input())
S = input()
if N%2 == 0:
  T = S[0:N/2]
  if T+T == S:
    print("Yes")
  else:
    print("No")
else:
  print("No")
//  [java]
import java.io.*;
 
class Main {
	public static void main(String[] args) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try{
			String line = reader.readLine();
			int n = Integer.parseInt(line);
			line = reader.readLine();
			char[] s =line.toCharArray();
			String ans = "Yes";
 
			if(n%2 != 0){
				ans = "No";
			}else{
				if(!(line.substring(0, n/2).equals(line.substring(n/2, n)))){
					ans = "No";
				}
			}
			System.out.println(ans);
		} catch(IOException e) {
			System.out.println(e);
		} catch(NumberFormatException e) {
			System.out.println(e);
		}
	}
}
//  [java]
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String S = sc.next();
    boolean answer = false;
    if(N%2==0){
      for(int i = 0;i<N/2;i++){
        if(S.charAt(i)==S.charAt(i+N)){
          if(i==N/2-1){
            answer = true;
          }
        }else{
          break;
        }
      }
    }
    if(answer){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}