jiahuimbzuai/CoQuIR huggingface dataset:
//  [c]
#include<stdio.h>
int main()
{
    int N,temp,i,j,k,count=0,a,b;
    scanf("%d",&N);
    int p[N];
    for(i=1; i<=N; i++)
    {
        scanf("%d",&p[i]);
    }
    for(i=1; i<=N; i++)
    {
        if(p[i]!=i)
        {
            a=p[i];
            break;
        }
    }
        for(j=i+1; j<=N; j++)
        {
            if(p[j]!=j)
            {
                b=p[j];
                break;
            }
        }

                temp=p[i];
                p[i]=p[j];
                p[j]=temp;

    for(k=1; k<=N; k++)
    {
        if(p[k]==k)
        {
            count++;
        }

    }
    if(count==N)
    {
        printf("YES");
    }
    else
        printf("NO");
    return 0;
}
//  [c]
int main()
{
  int a, b;
  scanf("%d %d", &a, &b);
  if ((a - b) % 2 == 0)
    printf("%d", abs((a - b) % 2));
  else
    printf("IMPOSSIBLE");
}
//  [c]
#include <stdio.h>

int	main(void)
{
	unsigned int	A, B;
	unsigned int	sum;

	scanf("%u %u", &A, &B);
	sum = A + B;
	if (sum % 2 == 0)
		printf("%d\n", sum / 2);
	else
		printf("IMPSSIBLE\n");
	return (0);
}
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split(" ");
	//文字列から10進数に変換するときはparseIntを使います
	var A = parseInt(input[0], 10);
	var B = parseInt(input[1], 10);
	var sumAB = A + B;
  	if(sumAB % 2){
    	console.log('%s',"IMPOSSIBLE");
    }else{
    	console.log('%d',sumAB / 2);
    }

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(arg){
  arg = arg.trim().split(' ').map(str => parseInt(str, 10));
  var a = arg[0], b = arg[1];
  var out = ((a+b)%2 === 0) ? (a+b)/2 : 'IMPOSSIBLE';
  console.log(out);
}
main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
const main = (A,B) => {
    K = Math.floor((A+B)/2)
    if(Math.abs(A-K) === Math.abs(B-K)) {
        return K
    }else{
        return "IMPOSSIBLE"
    }

}


const input = require('fs').readFileSync('/dev/stdin','utf8').split("\n")[0]
const AB = input.split(" ").map( x => Number(x))
console.log(main(AB[0],AB[1]))
//  [javascript]
const main = input => {
  const inputs = input.trim().split('\n')

  const N = parseInt(inputs[0])
  const sequence = inputs[1].split(' ').map(x => parseInt(x))

  const sortedSample = sequence.slice().sort((a, b) => a - b)

  let diff = 0
  for (let i = 0; i < N; i++) {
    //    console.log(sequence[i], sortedSample[i]);
    if (sequence[i] !== sortedSample[i]) {
      diff++
    }
  }

  diff === 2 || diff === 0 ? console.log('YES') : console.log('NO')

}
// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
//  [javascript]

function Main(input) {
  input = input.split("\n");
  var A = BigInt(parseInt(input[0].split(" ")[0]));
  var B = BigInt(parseInt(input[0].split(" ")[1]));
  if((A+B)%2n==0){
    var ans = (A+B)/2n;
  }else{
    var ans = "IMPOSSIBLE";
  }

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  input = input.split(" ");
  if((input[1]+input[0])%2==1){
  console.log("IMPOSSIBLE")
  }else{
  console.log(Math.abs((input[0]-input[1])/2));
  }
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

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

const (
	defaultBufferSize = 1024
	maxBufferSize     = 1e6
	Mod               = 1e9 + 7
)

var sc = bufio.NewScanner(os.Stdin)

// sc.Buffer(make([]byte, defaultBufferSize), maxBufferSize)

func readInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func readString() string {
	sc.Scan()
	return sc.Text()
}

func readInt64() int64 {
	sc.Scan()
	i, err := strconv.ParseInt(sc.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return int64(i)
}

func readfloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

func abs(a int) int {
	if a < 0 {
		return a * -1
	}
	return 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 gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func ModComb(n, k int) int {
	if k == 0 {
		return 1
	}
	x, y := n, k
	for i := 1; i < k; i++ {
		x = x * (n - i) % Mod
		y = y * (k - i) % Mod
	}
	inv := ModInv(y)
	return x * inv % Mod
}

func ModFact(x int) int {
	fact := 1
	for i := 1; i <= x; i++ {
		fact = fact * i % Mod
	}
	return fact
}

func ModInv(x int) int {
	return ModPow(x, Mod-2)
}

func ModPow(a, n int) int {
	res := 1
	for n > 0 {
		if n%2 != 0 {
			res = res * a % Mod
		}
		a = a * a % Mod
		n /= 2
	}
	return res
}

func pow(a, n int) int {
	if n == 0 {
		return 1
	}

	ans := 0
	if n%2 == 0 {
		ans = pow(a*a, n/2)
	} else {
		ans = a * pow(a*a, (n-1)/2)
	}
	return ans
}

func intSliceReverse(slice []int) []int {
	for i, j := 0, len(slice)-1; i < j; i, j = i+1, j-1 {
		slice[i], slice[j] = slice[j], slice[i]
	}
	return slice
}

func stringReverse(str string) string {
	runes := []rune(str)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func primeFactorization(x int) map[int]int {
	result := make(map[int]int, 0)
	for i := 2; i*i <= x; i++ {
		for x%i == 0 {
			result[i]++
			x /= i
		}
	}
	if x != 1 {
		result[x]++
	}
	return result
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	for i := 2; i*i <= x; i++ {
		if i == x {
			continue
		}
		if x%i == 0 {
			return false
		}
	}
	return true
}

func main() {
	sc.Split(bufio.ScanWords)
	a, b := readInt(), readInt()

	if (a+b)%2 == 0 {
		fmt.Println((a + b) / 2)
	} else {
		fmt.Println("IMPOSSIBLE")
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	if a > b {
		a, b = b, a
	}

	if (b-a)%2 == 1 {
		fmt.Println("IMPOSSIBLE")
	} else {
		fmt.Println(a + (b-a)/2)
	}
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func main() {
	sc.Split(bufio.ScanWords)
	a, b := nextInt(), nextInt()
	if (a+b)%2 == 1 {
		fmt.Println("IMPOSSIBLE")
	} else {
		fmt.Println((a + b) / 2)
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	if (a+b)%2 == 0 {
		fmt.Println((a + b) % 2)
	} else {
		fmt.Println("IMPOSSIBLE")
	}
}
//  [go]
// +build ignore
package main

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

func solve(sc *scanner, wr *bufio.Writer) int {
	A := sc.i()
	B := sc.i()

	x := B - A

	if x%2 == 1 {
		fmt.Println("IMPOSSIBLE")
	} else {
		fmt.Println((B + A) / 2)
	}

	return 0
}

func main() {
	sc := newScanner(os.Stdin)
	wr := bufio.NewWriter(os.Stdout)
	ret := solve(sc, wr)
	wr.Flush()
	os.Exit(ret)
}

// I/O
type scanner struct {
	sc *bufio.Scanner
}

func newScanner(input io.Reader) *scanner {
	sc := bufio.NewScanner(input)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &scanner{sc}
}

func (s *scanner) s() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *scanner) i() int {
	i, e := strconv.Atoi(s.s())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *scanner) f() float64 {
	f, e := strconv.ParseFloat(s.s(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *scanner) bs() []byte {
	return []byte(s.s())
}

func (s *scanner) is(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.i()
	}
	return res
}

func (s *scanner) fs(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.f()
	}
	return res
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	if (b-a)%2 == 0 {
		fmt.Println((b - a) + 2)
	} else {
		fmt.Println("IMPOSSIBLE")
	}
}
//  [ruby]
A, B = gets.split.map(&:to_i)

puts (A + B) % 2  == 0 ? (A + B)/2 : 'IMPOSSIBLE'
//  [ruby]
A, B = gets.split.map(&:to_i)

d = A + B
if d.even?
  puts d / 2
else
  puts 'IMPOSSIBLE'
end
//  [ruby]
A, B = gets.split.map(&:to_i)
if (A + B) % 2 != 0
  puts "IMPOSSIBLE"
else
  puts (A + B) / 2
end
//  [ruby]
a,b = gets.chomp.split(' ').map(&:to_i)
if (a-b).abs % 2 == 0
  puts (a-b).abs/2
else
  puts "IMPOSSIBLE"
end
//  [ruby]
n,m=gets.split.map &:to_i
puts (n+m).odd?? "IMPOSSIBLE": :(n+m)/2
//  [ruby]
n,m=gets.split.map &:to_i
puts (n+m).odd?? "IMPOSSIBLE": :No
//  [rust]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let v :Vec<usize> = read_vec();
    if (v[0] + v[1]) % 2 == 0 {
        println!("{}", (v[0]+v[1])/2);
    } else {
        println!("IMPOSSIBLE");
    }
}
//  [rust]
// Input macro
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! stdin {
    () => {{
        use std::io::Read;
        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }};
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

// Test Code
macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

// test code ==================================
test! {
    // example: 
    // "4 2 9" => "8",
    // "4 2 8" => "8"
    // r##""## => ""
    r#"2 16"# => "9",
    r#"0 3"# => "IMPOSSIBLE",
    r#"998244353 99824435"# => "549034394"
}

fn main() {
    println!("{}", solve(&stdin!()));
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        a: i32,
        b: i32,
    }
if (a+b)%2==0 {((a+b)/2).to_string()}else{String::from("IMPOSSIBLE")}
}
//  [rust]
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn f(s: &[char]) -> bool {
    let m = s.len();
    for i in 0..m {
        if s[i] != s[m - 1 - i] {
            return false;
        }
    }
    true
}

use std::iter::Iterator;
use std::cmp;


fn main() {
    input! {
        a : i64,
        b : i64
    }

    let x = a + b;
    let mut ans = String::from("IMPOSSIBLE");
    if x % 2 == 0 {
        ans = (x / 2).to_string();
    }
   
    println!("{}", ans);

}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main(){

    input!{
        a: usize,
        b: usize,
    }

    if (a+b)%2 != 0 {
        println!("Impossible");
    } else {
        let k = (a+b) / 2;
        println!("{}", k);
    }
    
}
//  [rust]
use std::cmp;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
    	a:usize,
        b:usize,
    }
       
    println!("{}", if a%2!=b%2 { "IMPOSSIBLE" } else { &(((a+b)/2).to_string()) });
}
//  [rust]
use std::cmp;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
    	a:usize,
        b:usize,
    }
       
    println!("{}", if a%2!=b%2 { "IMPOSSIBLE" } else { (a+b)/2 });
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let kotae = readInts()
let a = kotae[0]
let b = kotae[1]

if (a+b)%2==0 { 
  print((a+b)/2)
} else { 
  print("IMPOSSIBLE")
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
    
let ab = readInts()
let a = ab[0]
let b = ab[1]
if (a+b)%2==0{
  print(Int((a+b)/2))
}else{
  print("IMPOSSIBLE")
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let ab=readInts()
let a=ab[0]
let b=ab[1]

if a==b{
  print(a)
}else if (a+b)%2==0{
  print((a+b)/2)
}else{
  print("IMPOSSIBLE")
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
    
let abk = readInts()
let a = abk[0]
let b = abk[1]
let k = abk[2]
if (a>k)&&(b>k){
  print("IMPOSSIBLE")
}else if(a<=k)&&(b<=k){
  print("IMPOSSIBLE")
}else if (a+b)%2==0{
  print(Int((a+b)/2))
}else{
  print("IMPOSSIBLE")
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
    
let abk = readInts()
let a = abk[0]
let b = abk[1]
let k = abk[2]
if (a>k)&&(b>k){
  print("IMPOSSIBLE")
}else if(a<=k)&&(b<=k){
  print("IMPOSSIBLE")
}else if (a+b)%2==0{
  print(Int((a+b)/2)))
}else{
  print("IMPOSSIBLE")
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
    
let ab = readInts()
let a = nab[0]
let b= nab[1]
if (a>k)&&(b>k){
  print("IMPOSSIBLE")
}else if(a<=k)&&(b<=k){
  print("IMPOSSIBLE")
}else{
  print(Int((a+b)/2))
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

function compareFunc(a, b){
    return a-b;
}

const [a, b]: number[] = input[0].split(' ').map((x: string): number => +x);

if((a+b) % 2 === 0){
    console.log((a+b)/2);
}else{
    console.log('IMPOSSIBLE');
}
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let [a,b]=nrin(2)
  out((a + b) % 2 == 0?(a + b) / 2:'IMPOSSIBLE')
}
main()
//  [typescript]
const lines = require("fs")
  .readFileSync("/dev/stdin", "utf8")
  .trim()
  .split("\n");

const [a, b] = lines[0].split(" ").map(n => Number.parseInt(n));

const solver = () => {
  const answer = (a + b) / 2;
  if (answer !== Math.floor(answer)) {
    return "IMPOSSIBLE";
  } else {
    return answer;
  }
};

console.log(solver());
//  [typescript]
import * as fs from 'fs';

//in
// 2 16
//out
// 9
const main = (inp: string) => {
    const [a, b]: number[] = inp.split(' ').map(Number);
    let cap: number = 0;
    if (Math.abs(a) >= Math.abs(b)) {
        cap = Math.abs(a);
    } else {
        cap = Math.abs(b);
    }

    for (let k: number = 0; k < cap; k++) {
        const tmpA = Math.abs(a - k);
        const tmpB = Math.abs(b - k);

        if (tmpA === tmpB) {
            console.log(k);
            return;
        }
    }
    console.log('IMPOSSIBLE');
};

main(fs.readFileSync('/dev/stdin', 'utf8').trim());
//  [typescript]
const lines = require("fs")
  .readFileSync("/dev/stdin", "utf8")
  .trim()
  .split("\n");

const [a, b] = lines[0].split(" ").map(n => Number.parseInt(n));

const solver = () => {
  for (let i = 0; i < 10 ** 9; i++) {
    if (Math.abs(a - i) === Math.abs(b - i)) {
      return i;
    }
  }
  return "IMPOSSIBLE";
};

console.log(solver());
//  [typescript]
const a = Number.parseInt(process.argv[2]) / 2 + Number.parseInt(process.argv[3]) / 2

if (a !== Math.floor(a)) {
  console.log('IMPOSSIBLE')  
} else {
  console.log(a)
}
//  [python]
import math

n = int(input())
a = list(map(int, input().split()))

def gen_primes(limit):
    p = [] # それまでに生成した素数
    for i in range(2, limit+1):
        if i == 2 or all([i%j != 0 for j in p if j <= int(i**.5)]):
            p.append(i)
            yield i

for p in gen_primes(int(max(a)**.5)):
    if sum([i%p == 0 for i in a]) >= 2:
        break
else:
    print('pairwise coprime')
    exit()

gcd = a[0]
for i in a[1:]:
    gcd = math.gcd(gcd, i)
    if gcd == 1:
        print('setwise coprime')
        break
else:
    print('not coprime')
//  [python]
import math

n = int(input())
a = list(map(int, input().split()))

def gen_primes(limit):
    p = [] # それまでに生成した素数
    for i in range(2, limit+1):
        if i == 2 or all([i%j != 0 for j in p if j <= int(i**.5)]):
            p.append(i)
            yield i

factors = []
gcd = a[0]
for A in a:
    for p in gen_primes(int(A**.5)):
        if A%p == 0:
            factors.append(p)
            break
    else:
        factors.append(A)
    gcd = math.gcd(gcd, A)

if len(factors) == len(set(factors)):
    print('pairwise coprime')
elif gcd == 1:
    print('setwise coprime')
else:
    print('not coprime')
//  [python]
import math

n = int(input())
a = list(map(int, input().split()))

def gen_primes(limit):
    p = [] # それまでに生成した素数
    for i in range(2, limit+1):
        if i == 2 or all([i%j != 0 for j in p if j <= int(i**.5)]):
            p.append(i)
            yield i

factors = []
gcd = a[0]
for A in a:
    for p in gen_primes(int(max(a)**.5)):
        if A%p == 0:
            factors.append(p)
            break
    else:
        factors.append(A)
    gcd = math.gcd(gcd, A)

if len(factors) == len(set(factors)):
    print('pairwise coprime')
elif gcd == 1:
    print('setwise coprime')
else:
    print('not coprime')
//  [java]
import java.io.*;
import java.util.*;

public class Main {
    static PrintWriter __out = new PrintWriter(new OutputStreamWriter(System.out));
    final static int MAX = 1_000_000+10;

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int N = fs.nextInt();
        int [] a = fs.readArray(N);

        int cur = 0;
        for (int i : a) {
            cur = gcd(cur, i);
        }
        if (cur > 1) {
            System.out.println("not coprime");
            return;
        }
        int m = 0;
        int []c = new int[MAX];
        Arrays.fill(c,0);
        for (int i = 0; i < N; i++) {
            m = Math.max(m, a[i]);
            c[a[i]]++;
        }
        boolean []prime = new boolean[m+1];
        Arrays.fill(prime, true);
        for (int i = 2; i * i <= m; i++) {
            if (prime[i]) {
                int cnt = 0;
                for (int j = i; j <= m; j += i) {
                    prime[j] = false;
                    cnt += c[j];
                    if (cnt > 1) {
                        System.out.println("setwise coprime");
                        return;
                    }
                }
            }
        }
        System.out.println("pairwise coprime");

        }

    static int gcd(int a, int b) { return b==0 ? a : gcd(b, a%b);}
    static final Random random = new Random();

    static void ruffleSort(int[] a) {
        int n = a.length;//shuffle, then sort
        for (int i = 0; i < n; i++) {
            int oi = random.nextInt(n), temp = a[oi];
            a[oi] = a[i];
            a[i] = temp;
        }
        Arrays.sort(a);
    }

    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }


}
//  [cpp]
#include <iostream>
#include <numeric>

inline int read(){
	int x=0,f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=x*10+c-'0';c=getchar();}
	return x*f;
}

int cnt[1000001];

int main(){
  int n = read(), num = read(), g = num, ex = (n-1)/8;
  cnt[num] = 1;

  for(int i=0;i<ex;i++){
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    if(i-cnt[1]>80000){
      if(g==1) printf("setwise coprime\n");
      else printf("not coprime\n");
      return 0;
    }
  }

  for(int i=0;i<(n-1)%8;i++){
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
  }

  if(n - cnt[1] > 80000){
    if(g==1) printf("setwise coprime\n");
    else printf("not coprime\n");
    return 0;
  }

  if(g!=1){
    printf("not coprime\n");
    return 0;
  }

  int use[1000001];
  int max_S = 0;
  for(int i=2;i<=1000000;i++){
    if(use[i]==-1) continue;
    int S = 0;
    for(int j=i;j<=1000000;j+=i) {
      S += cnt[j];
      use[j] = -1;
    }
    if(max_S<S) max_S = S;
  }
  if(max_S<2) printf("pairwise coprime\n");
  else printf("setwise coprime\n");
}
//  [cpp]
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    constexpr int A_MAX = 1000000;
    vector<int> min_factor(A_MAX + 1);
    vector<int> q(A_MAX + 1, 1);
    vector<int> primes;
    for (int i = 2; i <= A_MAX; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
            primes.push_back(i);
        }
        int min_factor_i = min_factor[i];
        for (int p : primes) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor_i) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }
 
    int N = 0;
    char c = getchar_unlocked();
    do {
        N = 10 * N + c - '0';
    } while ((c = getchar_unlocked()) >= '0');
    vector<int> a(A_MAX + 1);
    for (int i = 0; i < N; ++i) {
        int A = 0;
        c = getchar_unlocked();
        do {
            A = 10 * A + c - '0';
    	} while ((c = getchar_unlocked()) >= '0');
        ++a[A];
    }
 
    bool is_pairwise_coprime = true;
    for (int n = A_MAX; n > 1; --n) {
        if (a[n] > 1) {
            if (a[n] == N) {
                printf("not coprime\n");
                return 0;
            }
            is_pairwise_coprime = false;
        }
        a[min_factor[n]] += a[n];
        a[q[n]] += a[n];
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }
 
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
 
#define A_MAX 1000000
#define A_MAX_HALF 500000
 
using namespace std;
 
int min_factor[A_MAX + 1];
int q[A_MAX + 1];
int a[A_MAX + 1];
vector<int> primes{ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 };
int N;
 
int read_int() {
    int x = 0;
    char c = getchar_unlocked();
    do {
      x = 10 * x + c - '0';
    } while ((c = getchar_unlocked()) >= '0');
    return x;
}
 
int main() {
    for (int i = 2; i <= A_MAX_HALF; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
        }
        int min_factor_i = min_factor[i];
        for (int p : primes) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor_i) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }
 
    char c = getchar_unlocked();
    do {
        N = 10 * N + c - '0';
    } while ((c = getchar_unlocked()) >= '0');
    for (int i = 0; i < N; ++i) {
        int A = 0;
        c = getchar_unlocked();
        do {
        	A = 10 * A + c - '0';
    	} while ((c = getchar_unlocked()) >= '0');
        ++a[A];
    }
 
    int is_pairwise_coprime = 1;
    for (int n = A_MAX; n > 1; --n) {
        int an = a[n];
        if (an) {
            if (an > 1) {
                if (an == N) {
                    printf("not coprime\n");
                    return 0;
                }
                is_pairwise_coprime = 0;
            }
            a[min_factor[n]] += an;
            a[q[n]] += an;
        }
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }
 
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
//#include<pair>
using namespace std;

typedef long long ll;
typedef int ii;
//typedef vector<ll> vi;

#define INF 1000000007

#define pi 3.141592654

#define T while(t--)
#define for2(i,a,b) for(i=a;i>=b;i--)
#define for3(i,a,b) for(i=a;i<=b;i=i+2)
#define for1(i,a,b) for(i=a;i<=b;i++)
#define pb push_back
#define mp make_pair

#include<sstream>

#define si set<ll>
#define se multiset<ll>

typedef long double ld;

typedef vector<ll> vi;

#define bb(arr,nn,xx) upper_bound(arr,arr+nn,xx)-arr
#define aa(arra,nna,xxa) lower_bound(arra,arra+nna,xxa)-arra

#define all(v) sort(v.begin(),v.end())
 
#define all1(v) sort(v.rbegin(),v.rend())

ll gcd(ll a,ll b)
{

    if(b==0) return a;

    
    return gcd(b,a%b);
    
}

ii main()
{

    ios::sync_with_stdio(0);
    cin.tie(0);

    ll n,i,j; cin>>n; vi v; ll x; ll f=0,g=0;
    
    for1(i,1,n)
    {
    
        cin>>x;
        
        v.pb(x);
        
    }
    
    
    for1(i,0,n-2)
    {
    
        for1(j,i+1,n-1)
        {
        
            if(gcd(v[j],v[i])!=1) {f++; break;}
            
        
        }
        
        if(f==1) break;
        
    }
    
    all(v);
    
    //cout<<v[0]<<"\n";
    
    if(f==0) cout<<"pairwise coprime"<<"\n";
        
    else
    {
        
        for2(i,v[0],2)
        {
        
            for1(j,0,n-1)
            {
                
             if(v[j]%i==0) {g++;}
            
            }
        
            if(g==3) break;
            else g=0;
            
            //if(g==1) break;
            
        }
        
        //cout<<g<<"\n";
        
        if(g<3) cout<<"setwise coprime"<<"\n";
        
        else cout<<"not coprime"<<"\n";
        
    }
    
    
}
//  [cpp]
#include <iostream>
#include<bits/stdc++.h>

using namespace std;

int arr[1000007] ;

int main()
{
    int n  ,  pairwise = 1 , i , j, g , f;
    scanf ("%d",&n) ;
    for (i=0 ; i<n ; i++ )
    {
                 scanf("%d",&arr[i]) ;
    }
    f = __gcd ( arr[0] , arr[1] );
    for ( i=0  ; i<n ;i++ )
    {
                 for (j=i+1 ; j<n ; j++)
                 {
                            g = __gcd (arr[j],arr[i]);
                            if ( g>1 )
                            {
                                 pairwise = 0 ;
                            }
                 }
                 f = __gcd(f,arr[i]);
    }
    if ( pairwise )
    {
                 printf("pairwise coprime") ;
    }
    else if ( f == 1 )
    {
                 printf("setwise coprime");
    }
    else
    {
                 printf("not coprime") ;
    }
    return 0;
}
//  [cpp]
#include <iostream>
#include<bits/stdc++.h>

using namespace std;

int arr[1000007] ;

int main()
{
    int n  ,  pairwise = 1 , i , j, g;
    scanf ("%d",&n) ;
    for (i=0 ; i<n ; i++ )
    {
                 scanf("%d",&arr[i]) ;
    }
    g = __gcd(arr[0],arr[1]) ;
    for ( i=2  ; i<n ;i++ )
    {
                 if (g>1)
                 {
                              pairwise = 0 ;
                 }
                 g = __gcd (g,arr[i]);
    }
    if ( pairwise )
    {
                 printf("pairwise coprime") ;
    }
    else if ( g == 1 )
    {
                 printf("setwise coprime");
    }
    else
    {
                 printf("not coprime") ;
    }
    return 0;
}
//  [c]
#include <stdio.h>
 
#define A_MAX 1000000
#define A_MAX_HALF 500000
 
int min_factor[A_MAX + 1];
int q[A_MAX + 1];
int a[A_MAX + 1];
int primes[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 };
int N;
 
int main() {
 
    for (int i = 2; i <= A_MAX_HALF; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
        }
        int j = 0;
        int min_factor_i = min_factor[i];
        for (int p = 2; ; p = primes[++j]) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor_i) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }
 
 
    char c = getchar_unlocked();
    while (c > 47) {
        N = 10 * N + c - 48;
        c = getchar_unlocked();
    }
 
    for (int i = 0; i < N; ++i) {
        int x = 0;
        c = getchar_unlocked();
        while (c > 47) {
            x = 10 * x + c - 48;
            c = getchar_unlocked();
        }
        ++a[x];
    }
 
    int is_pairwise_coprime = 1;
    for (int n = A_MAX; n > 1; --n) {
        int an = a[n];
        if (an) {
            if (an > 1) {
                if (an == N) {
                    printf("not coprime\n");
                    return 0;
                }
                is_pairwise_coprime = 0;
            }
            a[min_factor[n]] += an;
            a[q[n]] += an;
        }
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }
 
    return 0;
}
//  [c]
#include <stdio.h>
 
#define A_MAX 1000000
 
int min_factor[A_MAX + 1];
int q[A_MAX + 1];
int a[A_MAX + 1];
int primes[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 };
int N;

int main() {
 
    for (int i = 2; i <= A_MAX; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
        }
        int j = 0;
        for (int p = 2; ; p = primes[++j]) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor[i]) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }
 

    char c = getchar_unlocked();
    while (c > 47) {
        N = 10 * N + c - 48;
        c = getchar_unlocked();
    }

    for (int i = 0; i < N; ++i) {
        int x = 0;
        c = getchar_unlocked();
        while (c > 47) {
            x = 10 * x + c - 48;
            c = getchar_unlocked();
        }
        ++a[x];
    }
 
    int is_pairwise_coprime = 1;
    for (int n = A_MAX; n > 1; --n) {
        int an = a[n];
        if (an) {
            if (an > 1) {
                if (an == N) {
                    printf("not coprime\n");
                    return 0;
                }
                is_pairwise_coprime = 0;
            }
            a[min_factor[n]] += an;
            a[q[n]] += an;
        }
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }
 
    return 0;
}
//  [c]
#include <stdio.h>
 
#define A_MAX 1000000
#define A_MAX_HALF 500000
 
int min_factor[A_MAX + 1];
int q[A_MAX + 1];
int a[A_MAX + 1];
int primes[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 };
int N;
 
int main() {
 
    for (int i = 2; i <= A_MAX_HALF; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
        }
        int j = 0;
        for (int p = 2; ; p = primes[++j]) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor[i]) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }
 
 
    char c = getchar_unlocked();
    while (c > 47) {
        N = 10 * N + c - 48;
        c = getchar_unlocked();
    }
 
    for (int i = 0; i < N; ++i) {
        int x = 0;
        c = getchar_unlocked();
        while (c > 47) {
            x = 10 * x + c - 48;
            c = getchar_unlocked();
        }
        ++a[x];
    }
 
    int is_pairwise_coprime = 1;
    for (int n = A_MAX; n > 1; --n) {
        int an = a[n];
        if (an) {
            if (an > 1) {
                if (an == N) {
                    printf("not coprime\n");
                    return 0;
                }
                is_pairwise_coprime = 0;
            }
            a[min_factor[n]] += an;
            a[q[n]] += an;
        }
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }
 
    return 0;
}
//  [c]
#include <stdio.h>

long gcd(long a,long b){
  long r,tmp;
  if(a>b){
    tmp=a;
    a=b;
    b=tmp;
  }
  if(a==0) return b;
  r=b%a;
  while(r!=0)
    b=a;
  a=r;
  r=b%a;
}



int main(void){
  long n,a[1000005],count[1000005]={0},max=0,count1=0,k=0,gcd1=0;
    scanf("%ld",&n);
    for(int i=0;i<n;i++){
      scanf("%ld",&a[i]);
      count[a[i]]++;
      if(max<a[i]) max=a[i];
    }
    for(int i=2;i<=max;i++){
      k++;
      for(int j=i;j<max;j+=i){
        count1+=count[j];
      }
      if(count1>1) break;
       count1=0;
    }
    if(k==max-1){
      printf("pairwise coprime");
      return 0;
    }

    for(int i=0;i<n;i++){
      gcd1=gcd(gcd1,a[i]);
    }
    if(gcd1==1) printf("setwise coprime");
    else printf("not coprime");




    return 0;
  }
//  [c]
#include <stdio.h>

long gcd(long a,long b){
  long r,tmp;
  if(a>b){
    tmp=a;
    a=b;
    b=tmp;
  }
  if(a==0) return b;
  r=b%a;
  while(r!=0)
    b=a;
  a=r;
  r=b%a;
}



int main(void){
  long n,a[1000005],count[1000005]={0},max=0,count1=0,k=0,gcd1=0;
    scanf("%ld",&n);
    for(int i=0;i<n;i++){
      scanf("%ld",&a[i]);
      count[a[i]]++;
      if(max<a[i]) max=a[i];
    }
    for(int i=2;i<=max;i++){
      k++;
      for(int j=2;j<max;j+=i){
        count1+=count[j];
      }
      if(count1>1) break;
       count1=0;
    }
    if(k==max-1){
      printf("pairwise coprime");
      return 0;
    }

    for(int i=0;i<n;i++){
      gcd1=gcd(gcd1,a[i]);
    }
    if(gcd1==1) printf("setwise coprime");
    else printf("not coprime");




    return 0;
  }
//  [c]
#include<stdio.h>

int getgcd(int n,int m){
  int r;
  int tmp;
  if(n>m){
    tmp=n;
    n=m;
    m=tmp;
  }
  
  r=m%n;//n=a[i],m=a[j]
  while(r!=0){
  m=n;
  n=r;
  r=m%n;
  }
  //printf("n=%d ",n);
  return n;
}


int main(){
  int N;
  scanf("%d",&N);
  int c[N];
  int p=1,s=0;
  	
  int i;
  for(i=0;i<N;i++){
    scanf("%d",&c[i]);
    
  }
  
  int j,r,a,b;
  for(i=0;i<N-1;i++){
  	for(j=i+1;j<N;j++){
      
      b=getgcd(c[i],c[j]);
      //printf("(%d,%d)=%d\n",i,j,b);
      if(b!=1){
        p=0;
        break;
      }
      
  	}
    if(p==0) break;
  }
  
  
  for(i=2;i<N;i++){
    a=getgcd(c[0],c[1]);
    a=getgcd(a,c[i]);
    if(a==1) s=1;
  }
  
  //printf("%d %d\n",p,s);
  if(p==1) printf("pairwise coprime");
  else if(s==1) printf("setwise coprime"); 
  else printf("not coprime"); 
  
  //for(i=0;i<N;i++) printf("%d",c[i]);
  

	return 0;
}
//  [javascript]
function Main(input) {

    input = input.split("\n");
    
    N = Number(input[0]);
    let An = input[1].split(" ").map(Number);
    
    if (gcd(An) !== 1) {
        console.log("not coprime");
        return;
    }
        
    let freq = Array(1000001).fill(0);
    for(let A of An) {
        if (A === 1) continue;
        freq[A]++;
    }
    
    for (let i = 2; i <= 1000001; i++) {
        let tmp = 0;
        for (let j = i; j <= 1000001; j += i) {
            tmp += freq[j];
            if (tmp >= 2) {
                console.log("setwise coprime");
                return;
            }
        }
    }
    
    console.log("pairwise coprime");
    
}

function gcd(arg) {
    
    let f = (a, b) => b ? f(b, a % b) : a
    let ans = arg[0];
    for (let i = 1; i < arg.length; i++) {
        ans = f(ans, arg[i]); 
    }
    return ans;
    
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));