var [n, k] = readline().split(' ');
for (var i = 0; i < k; i++) {
  if (n % 10) {
    n--;
  }
  else {
    n /= 10;
  }
}
print(n);


var num = readline().split(" ").map(x => parseInt(x));
var h,l;
h=num[0],l=num[1];

const aStr = h.toString();
const aLength = aStr.length;
let aArr = aStr.split('').reverse();
aArr = aArr.map((data) => parseInt(data)+1);
var counter = 0;
var res = '';
while(aArr[counter] < l){
    l = l - aArr[counter];
    counter++;
}
aArr[counter] = aArr[counter] - l;

for(var i = aArr.length-1; i >= counter; i--) {
    if(aArr[i] == 0) continue;
    res += (aArr[i]-1).toString();
}

var r= parseInt(res);
print(r);


var numbers = readline().split(" ");
var n = numbers[0];
var k = numbers[1];

for(var i=0; i<k; i++){
        let e=n.toString();
        if(e.includes(0)){
            n=parseInt(e)/10;
        } else n=n-1  ;
    }
   print((n))
}


var n;
var k;
var input=readline().split(' ');
n=parseInt(input[0]);
k=parseInt(input[1]);
console.log(k);
for(let i = 1;i <= k;i++){
    if(n%10==0){
        n=n/10;
    }
    if(n%10!=0){
        n=n-1;
    }
}
print(n);


var num = readline().split(" ").map(x => parseInt(x));
var n,k;
n=num[0],k=num[1];

let result = n;
for(let i=0; i<k; i++){
	if(result % 10 === 0){
		result = result / 10;
	}
	else {
		result = result - 1;
	}
}
print(result);


var numbers = readline().split("").map(function(num){return parseInt(num)})

for(let i = 0; i < num; i++) {
  if (numbers[0] % 10 === 0)
    numbers[0] /= 10;
  else
    numbers[0]--;
}
print(numbers[0])


var numbers = readline().split(" ")
var k = numbers[0]
var n = numbers[1]
for(var i=0; i<k; i++){
        let e=n.toString()
        if(e.includes(0)){
            console.log(e)
            n=parseInt(e)/10;
        } else n=n-1
    }
print(n)


<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>zadacha</title>
</head>
<body>
	<script>
		let n = prompt("Введите число");
		let k = prompt("Введите число, который раз будет вычтанно");
			while(k>0){
			if(n%10!=0){
    		n-- ;
			}
			else{
			n=n/10;}
			k--;
			}
			alert(n);
	</script>

</body>
</html>


let input = readline().split(" ").map(function(x) { return parseInt(x); });

for(let i=0; i < input[1]; i++){
	if(input[0] % 10 == 0)
		input[0] /= 10;
	else input[0] -= 1;
}

print(input[0]);


const data = readline().split(' ').map(x => Number(x));
for (let i = data[1]; i > 0; i--) {
  if(data[0]%10 === 0) data[0] = data[0]/10;
  else data[0]--;
}
print(data[0]);


    function toNumber(x) { return +x; }
    // function readNumbers() { return readline().split(/\s/).map(function (x) { return toNumber(x); }); }
    function readNumbers() { return readline().split(/\s/).map(x => toNumber(x)); }

    var [n, k] = readNumbers();

    while (k--) {
        if (n % 10 != 0) {
            n--;
        } else {
            n /= 10;
        }
    }

    print(n);


var numbers = readline().split(" ");
var n = numbers[0];
var k = numbers[1];

for(var i=0; i<k; i++){
        var e=n.toString();
        if(e.includes(0)){
            n=parseInt(e)/10;
        } else n=n-1  ;
    }
   print((n))
}


function solve(n,k) {
    while (k--) {
        if (n == 0)
            break;
        let r = n % 10;
        if (r == 0)
            n /= 10;
        else
            --n;
    }
    return n;
}
var arr = readline().split(" ");
var n = arr[0];
var k = arr[1];
print(solve(n,k));


//根据codeforces给的v8编译环境，处理输入与输出

let inputs = readline().split(" ").map(x)=>+x;
let n = inputs[0];
let k = inputs[1];

// let n = 1000000000, k = 9;
function subtracte(n,k){

	for(let i = 0; i < k; i++){
		let last = n%10;
		if(last === 0){
			n /= 10;
		}else {
			n -= 1;
		}
	}
	// console.log(n);
	print(n);
}
subtracte(n, k);


numbers = readline().split("").map((num) => parseInt(num))

for(let i = 0; i < num; i++) {
  if (numbers[0] % 10 === 0)
    numbers[0] /= 10;
  else
    numbers[0]--;
}
print(numbers[0])


let n = prompt("Введите число");
		let k = prompt("Введите число, который раз будет вычтанно");
			while(k>0){
			if(n%10!==0){
    		n-- ;
			}
			else{
			n=n/10;}
			k--;
			}
			alert(n);


var input = readline().split(' ')
var number = Number(input[0]);
var times = Number(input[1]);

for(let i = 0; i < times; i++) {
    if(number % 10 == 0) {
        number /= 10;
    } else {
        number -= 1
    }
}

print(number)


var k = readline().split(" ");
var n = readline().split(" ");

for(var i=0; i<k; i++){
        var e=n.toString();
        if(e.includes(0)){
            n=parseInt(e)/10;
        } else n=n-1  ;
    }
   print((n))
}


function test(n,k){
    for(let i=1; i<k; i++){
        let e=n.toString()
        if(e.includes(0)){
            console.log(e)
            n=parseInt(e)/10;
        } else n=n-1
    }
    return n;
}


var str = readline();
var p = new RegExp("[HQ9]");
if(str.search(p)) != -1){print("YES");}
else					{print("NO");}


var s=readline();

if(s){
    print(/[HQ9]/.test(s)) ? 'YES' : 'NO')
}else{
print('NO')
}


var x = readline().split(" ");
var scores = readline().split(" ");
var cnt = x[0];
var lmt = x[1];
var t = 0;
var arr[];
for (var i = 0; i < cnt; i++) {
         if(!scores[i])
                  break;
         if(parseInt(scores[i]) >= parseInt(scores[lmt-1]))
                  t++;
         else
                  break;
}
write(t);


nk = readline("Enter n and k");
        valNLk = nk.split(" ");
        array = [];
        counter = 0;

        for (let i = 0; i < valNLk.length; i++) {
            value = valNLk[i];
            convertToNumber = parseInt(value);
            array.push(convertToNumber);
        }
        arr = [];
        if (array[0] >= array[1]) {
            secondLineInputs = readline("enter n numbers");
            secondLineSplited = secondLineInputs.split(" ");
            secondLineSplited.map(el => {
                arr.push(parseInt(el));
            })

            for (k = 0; k < array[1]; k++) {
                if (arr[k] == 0 && arr[k + 1] == 0) {
                    break;
                }
                if (arr[k] >= arr[k + 1]) {
                    counter++;
                }
                if(arr[k] == arr[array[1]]){
                    counter++;
                }
            }
        print(counter);
        }


nk = prompt("Enter n and k");
        valNLk = nk.split(" ");
        array = [];
        counter = 0;

        for (let i = 0; i < valNLk.length; i++) {
            value = valNLk[i];
            convertToNumber = parseInt(value);
            array.push(convertToNumber);
        }
        arr = [];
        if (array[0] >= array[1]) {
            secondLineInputs = prompt("enter n numbers");
            secondLineSplited = secondLineInputs.split(" ");
            secondLineSplited.map(el => {
                arr.push(parseInt(el));
            })

            for (k = 0; k < array[1]; k++) {
                if (arr[k] == 0 && arr[k + 1] == 0) {
                    break;
                }
                if (arr[k] >= arr[k + 1]) {
                    counter++;
                }
                if(arr[k] == arr[array[1]]){
                    counter++;
                }
            }
        print(counter);
        }


const readline = require('readline');

const arr = [];

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

rl.on('line', (input) => {

    arr.push(input)

    if(arr.length == 2) {
      compute(arr);
    }
});

function compute(arr) {

  var parsed = [];
  parsed.push(splitMNumber(arr[0]))
  parsed.push(splitMNumber(arr[1]))

  var limit = parsed[0][1]
  var last = -1;
  var sum = 0;

  for(let i=0;i<parsed[1].length;i++) {
      let current = parsed[1][i];
      if(current > 0 && (limit > 0 || current == last)) {
          sum++;
      }
      else {
        break;
      }
      limit--;
      last = current;
  }

  console.log(sum)

}

function splitMNumber(str) {
  return str.split(" ");
}


var datos =  readline().split(" ");
var corte = datos[1];
var participantes = datos[0];
var notas = readline().split(" ");
var cont= 0;
for (var i=0; i<notas.length;i++){
    if(notas[i]>corte){
        cont++;
            }else if(notas[0]!>0){
                print(0);
                }
                print (cont);

}


var x = readline().split(" ");
var scores = readline().split(" ");
var cnt = x[0];
var lmt = x[1];
var t = 0;
var arr[];
for (var i = 0; i < cnt; i++) {
         if(!score[i])
                  break;
         if(parseInt(scores[i]) >= parseInt(scores[lmt-1]))
                  t++;
         else
                  break;
}
write(t);


var [n, k] = readline();
var scores = readline();
var pass = scores[k-1];
print(scores.filter( x => x > 0 && x >= pass).length);


var nk = readline().split(' ');
var an = readline().split(' ');
var nextrnd = 0;

var n = nk[0];
var k = nk[1];

if(an[k - 1] > 0)
	nextrnd = k - 1;

if(an[k] > 0)
{
	var i = k;
	var found = false;
	while(i <= nk[0] && !found)
	{
		if(an[i] === an[k])
			nextrnd++;
			i++;
		else
			found = true;
	}
}

print(nextrnd);


process.stdin.resume();
process.stdin.setEncoding('utf-8');

let stdin = '';

process.stdin.on('data', (input) => {
  stdin += input;
});

process.stdin.on('end', () => {
  const data = stdin.split('\n');
  const [, k] = data[0].split(' ');
  const scores = data[1].split(' ');

  const kScore = scores[k - 1];

  const calculate = () => {
    let end = k;

    for (let i = k; i < scores.length; i++)
      if (scores[i] > 0 && scores[i] === kScore) end++;
      else break;

    return scores.slice(0, end).length;
  };


k = readline().split(' ');
k = k[1];
str = readline().split(' ').map(Number);

let res = 0;

for (let i = 0; i < str.length; i++) {
	if (str[i] > k) {
		res++;
	};
};

print (res);


var l = readline().split(' ')
var n = +l[0]
var k = +l[1]
var a = readline().split(' ').map(function(v){return v+ ;})
k=a[k-1]
a = a.filter(function(v){return v>=k&&v>0;})
print(a.length)


var countK = readline().split(' ');
var input = readline().split(' ');

var minScore = input[countK[1]];
var advance = 0;
for (let i = 0; i < input.length; i++) {
    if (+input[i] >= +minScore) advance++;
}
print(advance);


var nick = readline();
nick = nick.split.("")sort();
var noSeRepiten = nick.length;
var contador = 0;

for (var i=0; i<nick.length; i++) {
    if (nick[i]===nick[i+1]) {
        noSeRepiten--;
    }
}

if (noSeRepiten%2 === 0) {
    print("CHAT WITH HER!");
} else {
    print("IGNORE HIM!");
}


var datos = readline();
var original=
var nueva= [];
for(var i=0;i<datos.length;i++){
    var letra=datos[i];
    for(var j=0;j<datos.length;j++){
        var letrac=datos[j];
    if(letra==letrac){
        datos.splice(letrac,1);
        nueva.push(letra);
        contador++;
    }else{
        nueva.push(letra);
    }
    }
    }
if(nueva.length%2===0){
    print("IGNORE HIM!");
}else{
    print("CHAT WITH HER!");
}


let x=readLine().split();
let n =x[0];
n=parseInt(n);
print n;


let m = readline();
let n = readline();
let a = readline();

print(Math.ceil(n / a) + Math.ceil(m / a));


main(readline());
parseNMA(n, m, a){
  return ceil(n/a) * ceil(m/a);
}

function main(line){
  var nma = line.split(" ");
  var n = parseInt(nma[0]);
  var m = parseInt(nma[1]);
  var a = parseInt(nma[2]);
  print(parseNMA(n, m, a));
}


function solve(n, m, a){
    let long = n / a;
    let larg = m / a;
    return Math.ceil(long) * Math.ceil(larg);
}


const inp = readline();
const [n, m, a] = inp.split(" ").map(v => Number(v));

const answer = coverCount(n, m, a);

print(answer);

function coverCount(n, m, a) {
    return Math.ceil(n / a) * Math.ceil(m / a);
}


const [m, n, a] = readline().split(" ").map(x => parseInt(x));
print(Math.ceil(m/a)*Math.ceil(n/a));


 calculate =  (n1, n2) => Math.ceil(n1 / n2);
 let n = 0, m = 0, a = 0;
[n, m, a] = readline().split(' ');
print(calculate(n, a)*calculate(m, a));


var n=readline()
var m=readline()
var k=readline()
var x=(n+k-1)/k
var y=(m+k-1)/k
print y


function solve(n, m, a){
    let long = n / a
    let larg = m / a
    return Math.ceil(long) * Math.ceil(larg)
}


const nums = readline().split(" ").map(x => parseInt(x));
const [n, m , a] = nums;
print(Math.round(n/a)*Math.round(m/a));


function id (x,y) {
	return (x - x % y) / y
}

var numbers = readline().split(" ");
var n numbers = [0];
var m numbers = [1];
var a numbers = [2];

var resultat = 0;

var w = id(m, a);
var h = id(n, a);

var mr = (m % a);

if (mr !==0)
	w = w + 1;
if (nr !==0 )
	h = h + 1;

result = w * h;

print(result)


var readline = require('readline');
var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', function(line){
	if(!line) {
		process.exit()
	}
  const ancho, largo, baldoza = line.split(" ").map(n => Number(n));
  const cantidadVertical = Math.floor(largo / baldoza) + 1
  const cantidadHorizontal = Math.floor(ancho / baldoza) + 1

  return cantidadVertical * cantidadHorizontal;
})


process.stdin.read();

process.stdin.on("data", c => {
    const inp = c.toString();
    const [n, m, a] = inp.split(" ").map(v => Number(v));

    const answer = coverCount(n, m, a);

    console.log(answer);
    process.exit(0);
});

function coverCount(n, m, a) {
    return Math.ceil(n / a) * Math.ceil(m / a);
}


let input = readline().split(' ').map((item)=>{ return (+item); });

print (input[0]);


var a = readline();
var b = readline();
var c = readline();
var max = 0;
var abc = [a,b,c];
for (i in abc){
abc[i]=parseInt(abc[i]);
abc.sort(mySort);
if (abc[2]!==1){
if(abc[1]+abc[0]>=abc[1]*abc[0]){
	max = abc[2]*(abc[1]+abc[0]);}
else max = abc[2]*(abc[1]*abc[0]);
}
else max = abc[0]+abc[1]+abc[2];
print(max);
function mySort(a, b){return a-b;}


var string = "5+4+3+1",
	mas = [];

for (var i = 0, length = string.length; i < length; i++) {
	if(string[i]!="+") {
		mas[mas.length] = string[i];
	}
}

for (var i = 0, length = mas.length - 1; i < length; i++) {
	if(mas[i] < mas[i+1]) {
		for (var j = i+1, j < mas.length - 1; j++) {
			if (mas[i] < mas[j+1]) {
				var current = mas[i];
				mas[i] = mas[j+1];
				mas[j+1] = current;
			}
		}
	}
}

console.log(mas);


var str = readline();//.split(" ").map(function(x) { return parseInt(x); });

var numbers = str.split(+);
var ones = "";
var twos = "";
var threes = "";
for(i = 0; i < numbers.length; i++){
	if (numbers[i] == 1){

		if (ones == ""){
			ones += "1";
		}
		else{
			ones += "+1";
		}
	}
	if (numbers[i] == 2){
		if (twos == ""){
			twos += "2";
		}
		else{
			twos += "+2";
		}
	}
	if (numbers[i] == 1){
		if (threes == ""){
			threes += "3";
		}
		else{
			threes += "+3";
		}
	}

}
var summ = ones + "+" + twos + "+" + threes;
 print (summ);


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var str = prompt('', '');
        var numA = 0;
        for (var i = 0; i < str.length; i++) {
            if (str[i] == 'a')
                numA++;
        }
        var raz = str.length - numA;
        if (numA-raz>0) {
            alert(str.length);
        }
        else {
             if(numA-raz==0){
                 alert(str.length-1);
             }
             else{
                 alert(str.length-(raz-numA+1));
             }
        }
    </script>
</body>
</html>


var inputString = readline();
let str = inputString.split(" ");
print(str[1])
// inputString = inputString.toLowerCase();

// let strings = inputString.split(' ');
// let firstStrCounter = 0,
//     secondStrCounter = 0;

// for (let i = 0; i < strings[0].length; i++) {
//     if (strings[0].charCodeAt(i) > strings[1].charCodeAt(i)) {
//         firstStrCounter++;
//     } else if (strings[0].charCodeAt(i) < strings[1].charCodeAt(i)) {
//         secondStrCounter++;
//     }
// }

// print(firstStrCounter - secondStrCounter)


var l1 = readine();
var l2 = readine();
for(i in l1){
 if(l1[i].toLowerCase() < l2[i].toLowerCase()){
return -1;
}else{
return 1;}
}
return 0;
}


let inputString = readline();
inputString = inputString.toLowerCase();

let strings = inputString.split(' ');
let firstStrCounter = 0,
    secondStrCounter = 0;

for (let i = 0; i < strings[0].length; i++) {
    if (strings[0].charCodeAt(i) > strings[1].charCodeAt(i)) {
        firstStrCounter++;
    } else if (strings[0].charCodeAt(i) < strings[1].charCodeAt(i)) {
        secondStrCounter++;
    }
}
print(firstStrCounter - secondStrCounter);


function  solveSplitsProblem(n) {
    let result =  Math.floor((n/2 + 1));
    print(result)
}

let n = readline();
solveSplitsProblem(n);


    var n = readline();
    let result =  Math.floor((n/2 + 1));
    print(result);


(function f(n){
	if(n>2&&%2===0)
		console.log(YES);
	else
	console.log(NO);
})();


let w = readLine(parseInt());
function watermelon(w) {
    if(w>2 && w%2===0) {
        console.log("YES");
    } else {
        console.log("NO");
    }
}


let k = readLine()
if(k === 2 || k % 2 !== 0){
    print('NO')
}else{
    print('YES')
}


function delitarbuz = (w) => {
	if (w = 1 || w = 0) {
		return false;
	}
	if (w%2 === 0){
		return true;
	}
	if (w%2 != 0){
		return false;
	}
}

delitarbuz(prompt());


const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

let w;
rl.on('line', (input) => {
  w = input;
  console.log(w % 2 === 0 ? 'YES' : 'NO');

  rl.close();
});


const nmk = readline().split(" ").map((x) => { return parseInt(x); });
    const N = nmk[0];
    const M = nmk[1];
    const K = nmk[2];
    const numbers = readline().split(" ").map((x) => { return parseInt(x); });

    let cl = new Array(M + 1 - 1);

    // for (let i = 0; i < N; i++) {
    //     if (!(cl[numbers[i]])) {
    //         cl[numbers[i]] = [];
    //     }
    //     cl[numbers[i]].push(i + 1);
    // }
    //
    // let res = new Array(K);
    // let num = 0;
    // for (let i = 1; i < M + 1; i++) {
    //     for (let j = 0; j < cl[i].length; j++) {
    //         if (!(res[num])) {
    //             res[num] = [];
    //         }
    //         res[num].push(cl[i][j]);
    //         num = (num + 1) % K;
    //     }
    // }
    //
    // for (let i = 0; i < K; i++) {
    //     let resStr = res[i].length;
    //      for (let j = 0; j < res[i].length; j++) {
    //          resStr += ' ' + res[i][j];
    //      }
    //      print(resStr);
    // }
    print(1);


let w = prompt('what is weight','');
if(w>2)
    {
        w=w%2 ;
        if(w==0)
            {
                document.write('yes');
            }
        else
        {
            document.write('no') ;
        }
    }
else
    {
        document.write('no');
    }


let readline = require('readline');

let rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout
});

rl.question("", function(w) {
	if(w%2===0) {
		console.log("YES");
	} else {
		console.log("NO");
	}
	rl.close();
});


var kg = prompt ("Introduce peso de la sandia");
kg = parseInt(kg);
if ((kg>=1)&&(kg<=100)){}
if ((kg%2==0)&&(kg>2)){
	document.write ("YES");
} else {document.write ("NO");
}}


let w = readline();

w%2 === 0 ? print('YES') : print('NO');


let w = prompt('what is weight','');
if(w>2)
    {
        w=w%2 ;
        if(w==0)
            {
                console.log('yes');
            }
        else
        {
            console.log('no') ;
        }
    }
else
    {
        console.log('no');
    }


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
    const x = readline();
   console.log(divideEvenWatermelon(x)
}
function divideEvenWatermelon(weight) {
    if ((weight < 1 && weight > 100 ) || (weight % 2 !== 0)) console.log('NO');
    let evenWeights = [];
    for (let i = 0; i < weight; i++) {
        if (i % 2 === 0 && i > 0) {
            evenWeights.push(i);
        }
    }
    for (let i = 0; i < evenWeights.length; i++) {
        for (let j = 0; j < evenWeights.length; j++) {
            if (evenWeights[i] + evenWeights[j] === weight) console.log('YES');
        }
    }
}


let a = prompt();
a = Number.parseInt(a);
const isEven = (num) => Math.floor(a/2) * 2 === a;

console.log(isEven(a) && a !== 2 ? "YES" : "NO")


var pesos = new Array(100 + 1);
var peso = Number(readline());

pesos[0] = pesos[1] = pesos[2] = "NO";
for(let i = 3; i < 100 + 1; ++i)
{
	pesos[i] = (i%2 === 0 ? "YES" : "NO");
}

print(pesos[peso]);


let w = readline();
print(w%2===0 && w>2 ? "YES":"NO");


var input = readline().split(' ');
var check = false;
for(var i=2;i<input[0] ; i+=2) {
  if( (input[0] - i % 2 == 0 ) check=true;
}
print(check);


let weight = readline();
if (weight % 2 == 0 && weight > 2) {
  console.log("YES");
} else {
  console.log("NO");
}


let a = readLine();
a = Number.parseInt(a);
const isEven = (num) => Math.floor(a/2) * 2 === a;

console.log(isEven(a) && a !== 2 ? "YES" : "NO")


let x = readline();
if (!(x & 1) && x != 2)print("YES"); else print("NO");


let line = readline().split(' ');
let b = parseInt(line[0]) - 2;
console.log((b > 0 && b % 2 === 0) ? 'YES' : 'NO')


let w = readline();

if (w % 2 === 0) {
    print('YES');
} else if (w === 2) {
    print('NO');
} else {
    print('NO');
}


console.log(process.argv[2]%2 === 0 ? "YES", "NO")


const readline = require("readline");
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false,
});

let max_lines = -1;
let line_cont = 0;
let array = [];

rl.on("line", (line) => singleDigit(line));

// const oneNumberSeq = (line) => {
//   if (max_lines == -1) {
//     max_lines = line; // 3
//     return;
//   }
//   //build array
//   array[line_cont] = line.trim().split(" ");

//   line_cont++;
//   if (line_cont == max_lines) {
//     main(array);
//   }
// }
const singleDigit = (line) => {
  main(line)
}

// const twoNumberSeq = (line) => {
//   if (max_lines == -1) {
//     seq = line.trim().split(" ")
//     max_lines = seq[0] * seq[1] ; // 3
//     return;
//   }
//   //build array
//   array[line_cont] = line.trim().split(" ");

//   line_cont++;
//   if (line_cont == max_lines) {
//     main(array);
//   }
// }

const main = (w) => {
  console.log(w % 2 == 0 ? 'YES' : 'NO');
};


//const readline = () => `8`;
//const print = (str) => console.log(str);

const [w] = readline().split(" ").map(x => parseInt(x));

const ok = () => {
    print("YES");
};

const fail = () => {
    print("NO");
};

(() => {

    if (!(w >= 1 && w <= 100)) {
        return fail();
    }

    if (w % 2 === 0) {
        return ok();
    }

    fail();

})();


var line = readline().split(' ')
if ( line[0] > 3 && line !% 2 ) print('YES')
else ('NO')


let lines = line.split('\n').join('')
let firstLine = lines[0]

return firstLine % 2 === 0 ? 'YES' : 'NO'


<script>
(function f(){
	 var nums = readline().split(' ');
    var n = nums[0];
//	var n = parseInt(s);
	if(n>=2&&n%2!==0){
		//console.log("NO");
		print("NO");
	}
	else
		//console.logt("YES");
	  print("YES");

	return 0;
})();


var a = readLine();
function task1(a){
    return (a%2)==0&&a!=2 ? "YES":"NO"
}
task1(a);


let w= readline() ;
if(w>2)
    {
        w=w%2 ;
        if(w===0)
            {
                print('yes');
            }
        else
        {
           print('no') ;
        }
    }
else
    {
        print('no');
    }


var inData = readline(2 4).split(' ');

var a = inData[0],
		b = inData[1];

var firs = 0,
		last = 0;

if (a >= b) {
	firs = b;
	last = (a-b != 0) ? parseInt( (a-b)/2 ) : 0;
} else {
	firs = a;
	last = parseInt( (b-a)/2 );
}

write(firs+" "+last);


function foo(m, s) {
  if (m*9 < s || s === 0) {
    return { min: '-1', max: '-1' }
  }

  const maxArr = [];

  let i=0;
  while (i != m) {
    if (s/9 >= 1) {
      maxArr[i] = 9;
      s -= 9;
    } else {
      maxArr[i] = s;
      s -= s;
    }

    i++;
  }

  let max = '';
  for (let j=0; j<maxArr.length; j++) {
    max += maxArr[j];
  }

  const minArray = maxArr.reverse();

  if (s === maxArr[0]) {
    minArray[m-1]--;
    minArray[0] = 1;
  }

  let min = '';
  for (let k=0; k<minArray.length; k++) {
    min += minArray[k];
  }

  return { min, max };
}

const args = readline().split(" ").map(function(x) { return parseInt(x); });

const res = foo(args[0], args[1]);

write(res.min + ' ' res.max);


var input = readline().split();
var obj = {}
for(var j=0; j< input.length; j++){
    var temp = input[j];
    obj[temp]?obj[temp]++: obj[temp]=0;
}

if(obj['7'] !== undefined && obj['7']===7){
    print("YES");
}else(obj['4'] !== undefined && obj['4']===4){
    print("NO");
}


function inArray(value, array) {
    return array.indexOf(value) > -1;
}

function isCapLocked(word) {
    function isComplete(word) {
        return word.toUpperCase() == word;
    }
    function isPartial(word) {
        var [first, ...rest] = word;
        return (
            first.toLowerCase() == word[0] &&
            rest.join('').toUpperCase() == word.slice(1)
        );
    }
    return isComplete(word) || isPartial(word);
}

function removeCapsLock(word) {
    if (isCapLocked(word)) {
        var [first, ...rest] = word;
        return first.toUpperCase() + rest.join('').toLowerCase();
    }
    return word
}

var input = readline();
// var input = 'cAPS';
// var input = 'Lock';
// var input = 'CAPS';

print(removeCapsLock(input));
// console.log(removeCapsLock(input));


var lee = readline();

if (lee.slice(1) == lee.slice(1).toUpperCase() $$ lee[0] == lee[0].toLowerCase()) {
	print(lee[0].toUpperCase() + lee.slice(1).toLowerCase());
} else if(lee == lee.toUpperCase()) {
	print(lee.toLowerCase());
} else {
    print(lee);
}


let input = readline();
if(input[0] != input.toUpperCase()) {
    print(input[0].toUpperCase() + input.substring(1).toLowerCase());
} else {
    print(input);
}


public Class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr = new int[n];
        for(int i=0; i<m; ++i) {
            int x = sc.nextInt();
            if(arr[x-1]==0) arr[x-1]=x;
            else break;
        }
        for(int i=0; i<n; ++i) System.out.print(arr[i] + " ");
    }
}


or(var i = 0; i<5; i++){
    var j = readline().split(" ").indexOf('1');
    if(j>-1){
        break;
    }
}

print(Math.abs(2-i)+Math.abs(2-j));


let row = 0;
let moves = 0;

while(row < 5){
    const columns = readline().split(' ');
    const col = columns.indexOf('1');
    if (col !== -1){
        moves = Math.abs(2 - row) + Math.abs(2 - column);
    }
    row++;
}

console.log(moves)


for (let i = 0; i < 5; ++i) {
  const line = readline().split(' ');
  for (let j = 0; j < 5; ++j) {
    if (line[j] === '1') {
      print(Math.abs(i-2) + Math.abs(j-2));
      break;
    }
  }
}


import java.util.*;

class A{

    public static void main(String[] args){
        int limak , bob , noOfYears ;
        noOfYear=0;

        Scanner myObj = new Scanner(System.in);

        limak=myObj.nextInt();
        bob=myObj.nextInt();
        if(limak >=1 && limak <=10 && bob>=1 && bob<=10){
    while(limak <= bob){
        limak*=3;
        bob*=2;
        noOfYear++;
    }
        }
    System.out.println(noOfYear);

    }
}


var input = readline().split(' ').map(function(x) { return parseInt(x); });
var a = input[0];
var b = input[1];

function bear (a,b){
	let count = 1 ;
	while ( a< b) {
		a = Math.pow(a,2);
		b = Math.pow(b,3);
		count ++ ;
	}

	return count;
}

bear(a,b);


var inputs =[] ,years = 0;

inputs= readline().split(' ');
let a = Number(inputs[0]);
let b = Number(inputs[1]);

while(a <= b){
    a=a*3 ;
    b=b*2;
   // inputs[0]= inputs[0]*3 ;
    //inputs[1]=inputs[1]*2 ;
    years++;

}
print(years);


var input = parseInt(readline());
var str = "";
for(int i=1; i<= input; ++i){
    s = s.concat(i);
}
print(s.charAt(n-1));


var input = parseInt(readline());
var str = "";
for(int i=1; i<= input; ++i){
    str = str.concat(i);
}
print(s.charAt(n-1));


function findC(n, m)
{
if (n > m)
return n - m;

if(n == m)
return 0;

int ctr = 0;
for (var inc = 0; n < m; ctr += (inc + 1))
{
m >>= 1;
inc = m & 1;
m += inc;
}
return n - m + ctr;
}

(function (){
    var numbers = readline().split(" ");
    print(findC(parseInt(numbers[0]), parseInt(numbers[1])));
})


{
    function FindC(N, M){
      if(N == M) return 0;
      let flags = [];
      let queue = [];
      let c = 0;
      let size = 0;
      queue[0] = [N, 1];
      flags[N] = true;
      while(queue.length > 0){
          let node = queue[c++];

          let value = node[0];
          let count = node[1];

          let le = value - 1;
          let ri = value * 2;
          if(le == M || ri == M){
              return count;
          }
          if(!flags[le] && le >= 1){
              queue[++size] = [le, count + 1];
              flags[le] = true;
          }
          if(!flags[ri] && ri < 2*M){
              queue[++size] = [ri, count + 1];
              flags[ri] = true;
          }
      }
    }

    let numbers = readline().split(" ");
    print(FindC(parseInt(numbers[0]), parseInt(numbers[1])));
}


function FindC(N, M){
  if(N == M) return 0;
  let flags = [];
  let queue = [];
  let c = 0;
  let size = 0;
  queue[0] = [N, 1];
  flags[N] = true;
  while(queue.length > 0){
      let node = queue[c++];

      let value = node[0];
      let count = node[1];

      let le = value - 1;
      let ri = value * 2;
      if(le == M || ri == M){
          return count;
      }
      if(!flags[le] && le >= 1){
          queue[++size] = [le, count + 1];
          flags[le] = true;
      }
      if(!flags[ri] && ri < 2*M){
          queue[++size] = [ri, count + 1];
          flags[ri] = true;
      }
  }
}


let word = prompt("Enter a word");
let upperCase =0 , lowerCase =0;
for (const ch of word){
    if (ch == ch.toUpperCase()){
        upperCase ++;
    }
    else{
        lowerCase ++;
    }
}
if (upperCase > lowerCase){
    alert(word.toUpperCase());
}
else{
    alert(word.toLowerCase());
}


var number = parseInt(readline());
var isSemiHappy = generateHappyNumbers(1000).filter(x => number % x === 0).length;
print(isSemiHappy ? "YES" : "NO");

function generateHappyNumbers(rightBorder) {
    var numbers = [];
    var current = 0;
    var sequenceLength = 1;
    var possibleDigits = [4, 7];
    generator(possibleDigits, numbers, 5);
    numbers = numbers.map(x => parseInt(x)).filter(x => x < rightBorder).sort((a, b) => {
        return Math.sign(a - b);
    });

    return numbers;
}

function generator(elements, result, maxLength, prefix = "") {
    result.push(prefix);
    if (prefix.length == maxLength) {
        return;
    }
    elements.forEach(element => {
        generator(elements, result, maxLength, prefix + element);
    });
}


var r = readline().split(" ");
var pairs_of_socks = +r[0];
var m-th_day = +r[1];
var	result = pairs_of_socks + Math.floor((pairs_of_socks-1)/(m-th_day-1));
print(result);


var num = readline().split(" ").map(x => parseInt(x)); // num will be an array [1,2,3]
var x = num[0];
var y = num[1];

print(x+((x-1)/(y-1));


var
	r = readline().split(' '),
	pairs_of_socks = +r[0],
	m-th_day = +r[1]
;

if(pairs_of_socks == m-th_day){
	print(pairs_of_socks + 1);
}else{
	print((pairs_of_socks + m-th_day) + 1);
}


var input = readline();
var ans='';
for(let i of input){
    if('aeiou'.indexOf(i.toLowerCase()) ==-1){
        ans+='.'+i.toLowerCase();
    }
}
print(ans);

// print(readline().replace(/[aoyeui]/ig, '').replace(/(.)/ig, ".$1").toLowerCase());

// input = 'Codeforces'
// ans=''
// for(let i of input){
//     if('aeiou'.indexOf(i.toLowerCase()) ==-1){
//         ans+='.'+i.toLowerCase();
//     }
// }
// console.log(ans);


var x = readline().split(" ");
var arr = ["A","a", "O","o", "Y","y", "E","e", "U","u", "I","i" ];
var wrd[];
for( var i=0; i < x.length; ++i ){
         for( var j=0; j < arr.length; ++j )
                  if(x[i] == arr[j])
                          continue;
         wrd[i] = s[i];
}
for (var i = 0; i < wrd.length; i++) {
         write("." + wrd[i]);
}


/**
 * @author Albert Hambardzumyan
 * @description String Task.
 *  Reference: http://codeforces.com/problemset/problem/118/A
 *  Tags: implementation, strings, 1100
 */
(function () {
  const input = readline().toLowerCase()

  let result = ''
  let temp
  for (let i = 0; i < input.length; i++) {
    temp = input.charAt(i);
    if (!(temp === 'a' || temp === 'o' || temp === 'y' || temp === 'e' || temp === 'u' || temp === 'i'))
    result += `.${temp}`
  }

  print(result)
})()


var s1=readline();
var s2=readline();
 s2.reverse();
 print(s1===s2)?"YES":"NO");


// You are given a rectangular board of M × N squares. Also you are given an unlimited number of standard domino pieces of 2 × 1 squares. You are allowed to rotate the pieces. You are asked to place as many dominoes as possible on the board so as to meet the following conditions:

// 1. Each domino completely covers two squares.

// 2. No two dominoes overlap.

// 3. Each domino lies entirely inside the board. It is allowed to touch the edges of the board.

// Find the maximum number of dominoes, which can be placed under these restrictions.
// Input

// In a single line you are given two inpegers M and N — board sizes in squares (1 ≤ M ≤ N ≤ 16).
// Output

// Output one number — the maximal number of dominoes, which can be placed.

var inp = readline().split(' ')

if (inp[1]%2>0){
    print(parseInt(inp[1]/2) * inp[0] + parseInt(inp[0]/2]))
}else {
    print(inp[1]/2*inp[0])
}


m = readline();
n = readline();

print (Math.floor((m*n)/2);


var numbers = readline().split(" ").map(function(x){ return parseInt(x)});

print(((numbers[0] * numbers[1]) - (numbers[0] * numbers[1] mod 2))/2);


'use strict';

const fs = require('fs');

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.replace(/\s*$/, '')
        .split('\n')
        .map(str => str.replace(/\s*$/, ''));

    main();
});

function readLine() {
    return inputString[currentLine++];
}
////

Function coins(n){
	var coins =[];
	coins.push(n);
	while(n!=1){
		if(n%2 ==1){
			n=1;
			coins.push(n);
		}
		else{
			n=n/2;
			coins.push(n);
		}
	}
	return coins.join(" ");
}

/////
function main() {
    const ws = fs.createWriteStream(process.env.OUTPUT_PATH);

    const n = parseInt(readLine(), 10);

   /* for (let tItr = 0; tItr < t; tItr++) {
        const nms = readLine().split(' ');

        const n = parseInt(nms[0], 10);

        const m = parseInt(nms[1], 10);

        const s = parseInt(nms[2], 10);

    }*/
	let result = coins(n);
	ws.write(result + "\n");

    ws.end();
}


let input = readline().split(' ');
let [n, k] = input,  T = 240, t = T - k, taskT = [0];
for(let i = 1; i < 11; i++) taskT[i] = 5 * i + taskT[i - 1];
let left = 0, right = n;
while(left <= right) {
  let  mid = parseInt(right - (right - left) / 2);
  if(taskT[mid] >= t) right = mid - 1;
  else left = mid + 1;
}
print(Math.min(right,n));


var n = readline();
var arr = [];
for(var i = 0; i < arr[]; i++)
	if(arr[] == 1)
		print("HARD");
	else
		print("EASY");


readline();
let a = readline();
let b = a.length - 1;
for (; b; b--) {
  if (a[b] == 1) return 'HARD';
}
return 'EASY';


readline();
var a = readline();
var b = 5;
var c = 'EASY';
for (; b; b--) {
  if (a[b - 1] == 1) {
     c = 'HARD';
     break;
  }
}
print c;


'use strict'
readline();
let a = readline();
let b = a.length - 1;
for (; b; b--) {
  if (a[b] == 1) {
     write 'HARD';
     return
  }
}
write 'EASY';


readline();
var a = readline();
var b = a.length - 1;
var c = 'EASY';
for (; b > 0; b--) {
  if (a[b] == 1) {
     c = 'HARD';
     break;
  }
}
print c;


let n = prompt("a?").split(" ");
const x = n[0];
const y = n[1];
const z = n[2];
const t1 = n[3];
const t2 = n[4];
const t3 = n[5];
const elevatorDistance = getElevatorDistance(x,y,z);
const ladderDistance = getLadderDistance(x,y);
function getElevatorDistance(x,y,z) {
  let dis1 = Math.abs(x-z);
   let dis2 = Math.abs(x-y);
   let distance = dis1 + dis2;
   return distance;
}
function getLadderDistance(x,y) {
   return Math.abs(x-y);
}
function getElevatorTime(t2,t3) {
  return t3*3+elevatorDistance*t2;
}
function getLadderTime(t1) {
  return t1*ladderDistance;
}
if (getElevatorTime(t2,t3) <= getLadderTime(t1)) {
  alert("YES");
} else {
  alert("NO");
}


  var entrada = readline();
        var resultado;

            if(entrada%2==0)
                resultado/2;
            }else
            {resultado= Math.floor(resultado/2)*-1 ;
            }

        print(resultado);


    var entrada = readline();
        var resultado;

            if(entrada%2==0)
                resultado/2;
            }else(entrada%2!=0)
            {resultado= Math.floor(resultado/2)*-1 ;
            }

        print(resultado);


    var n = readline();
    print((n % 2 === 0) ? n/2 : -(Math.floor(n/2));


    var entrada = readline();
    var resultado=0;
    for (var i=1;i<=entrada;i++){

        if(entrada%2==0)
            resultado /=2;
        }else if(entrada%2!=0)
        {resultado= Math.floor(resultado/2)*-1 ;
        }

    }
    print(resultado);


        var k = Number(readline().split(" ")[1]);
    var line = readline();
    function(){
        var loc = line.indexOf("G");
    var finalLoc = line.indexOf("T");
    var start = Math.min(loc, finalLoc);
    var finish = Math.max(loc, finalLoc);
    for(var i=start;i<finish;i+=k){
        if(line[i] == "#"){
           return print("NO");
        }
    }
    return print("YES");
    }();


function (){
    const z = readline().split('').map(String);
    const x = readline().split('').map(String);
    let y = 0;
    for (let i=0; i <= x.length - 1; i++){
        if(x[i][0] == n[0] || x[i][1] == n[1]){
            y = y + 1;
        }
    }
    if(y===0){
        print('NO');
    }else{
        print('Yes');
    }
    }


let stdin = process.stdin;
stdin.setEncoding('utf8');
stdin.on('data', function (data) {
    let input = data.split('\n');
    console.log(solution(input[0]; input[1]));
});

// End of interface
*/

const solution = (cardOnTable, cardsInHand) => {
  if (cardsInHand.indexOf(cardOnTable[0]) >= 0 || cardsInHand.indexOf(cardOnTable[1]) >= 0){
	return "YES";
  } else {
	return "NO";
  }
};


var input = readline().split(" ");
var count = 0;
for(let i=1; i<input.length;){
    if(input[i]==input[i-1]){
        count++;
        i==2;
    }else{
        i++
    }
}
print(count);


minLength = +readline().split(' ')[0];
data = readline().split(' ')[1].split('');
currentLength = 1;
currentColor = data.pop();

for (let i = data.length; i--;) {
	if (data[i] === currentColor) {
		currentLength++;
		continue;
	}

	if (minLength > currentLength) {
		minLength = currentLength;
	}

	currentLength = 1;
	currentColor = data[i];
}

print(minLength - 1);


input = readline().split(' ');

minLength = parseInt(input[0]);
data = input[1].split('');
currentLength = 1;
currentColor = data.pop();

for (let i = data.length; i--;) {
	if (data[i] === currentColor) {
		currentLength++;
		continue;
	}

	if (minLength > currentLength) {
		minLength = currentLength;
	}

	currentLength = 1;
	currentColor = data[i];
}

print(minLength - 1);


var valores = readline().split(" ");
var ptoalla = valores[0];
var centimos = valores[1];
var ptotal=ptoalla;
var contador=1;

while ((ptotal%10!=0)&&((ptotal-centimos)%10!=0){
	contador++;
	ptotal=contador*ptoalla;
}
print(parseInt(contador);


var valores = readline().split(" ");
var ptoalla = valores[0];
var centimos = valores[1];
var ptotal=ptoalla;
var contador=1;

while (!ptotal%10==0||!((ptotal-centimos)%10==0){
	contador++;
	ptotal=contador*ptoalla;
}
print(contador);


var input  = readline();

var numbers = ['144', '14', '1'];

for (let index = 0; index < numbers.length; index++) {
    input = replaceAll(numbers[index]);
}

print(input && input.length === 0 ? 'YES' : 'NO');


let i = readline();
let year = '';
i = Number(i);

while(i <= 9000){
  i++;
  b = false;
  for(let j=0 ; j<4 ; j++)
  {
    let s = String(i);
    s[j] = 'n'
    if (~s.indexOf(i[j])){
      b = true;
      break;
    }
  }
  if (b === false) break;
}
print(i);


let i = readline();
while(i <= 9000){
  i++;
  b = false;
  for(let j=0 ; j<4 ; j++)
  {
    let s = String(i);
    s[j] = 'n'
    if (~s.indexOf(i[j])){
      b = true;
      break;
    }
  }
  if (b === false) break;
}
print(i);


'use strict';

const numbersDifferent = function(array) {
    let obj = {};
    for (let i = 0; i < array.length; i++) {
        if (obj[array[i]]) {
            return false;
        } else {
            obj[array[i]] = array[i]];
        }
    }

    return true;
}

const year = parseInt(readline());

do {
    year++;
} while(!numbersDifferent(String(year).split('')));

write(year);


var line = readline();

var c = 0;
for(vat i = 0 ; i < line.length; i++) {
  c += (line[i] == 'x') ? 1 : 0;
}

print(Math.abs(c - (line.length >> 1)));


function ansa(a,b,c,d){

  var p1 = []
  var p2 = []
  var yes = 0;

  for(var i = 0 ; i < 1005 ; i++){
    p1[i] = b + i * a;
    p2[i] = d + c * i;
  }
  for(var i = 0 ; i < 1005; i++){
    for(var j = 0 ; j < 1005 ; j++){
      if(p1[i] === p2[j]){
        print(p1[i]);
        yes = 1;
      }
    }
  }

  if(yes === 0)print("-1");

}

var line = readline().split(' ');
for(var i = 0 ; i < line.length ; i++) line[i] = parseInt(line[i]);
var line2 = readline().split(' ');
for(var i = 0 ; i < line.length ; i++) line[i] = parseInt(line[i]);

ansa(line[0],line[1],line2[0],line2[1y]);


var main = function(r, b, g) {
    print Math.min((r+g), (b+g), (r+g), Math.floor((r+b+g)/3));
}

main.apply(0, readline().split(' ').map(Number)


let lines = parseInt(readline());

let mult = [1, 3, 6, 10];

for (let x = 0; x < lines; x++) {
  let num = readline();
  let f = parseInt(num[0]);
  let res = (f - 1) * 10 + mult[num.length - 1];
  print(res);
}


/* #################################################################
 * This solution has been prepared for TheCodingConversations google
 * meet session to be held on 2020-10-25. If you wish to participate
 * in this session kindly refrain from reading this solution until
 * the session has been concluded.
 *
 * @author - atifcppprogrammer
 * ################################################################# */

const N = parseInt(readline());
const m = [0, 1, 3, 6, 10];

for (let i = 0; i < N; ++i) {
  const s = readline();
  const u = parseInt(s[0]);
  return (u - 1) * 10 + m[s.length];
}

/* ################################################################# */


// 441A     Валера и антиквариат

var n = parseInt(readline());

// var input_line = readline().split(' ').map(Number);
var arr = readline().split('').map(Number);

var out = '';

for (var i = 0; i < n; i++) if (arr[i] === '9') out += '9';
for (var i = 0; i < n; i++) if (arr[i] === '7') out += '7';
for (var i = 0; i < n; i++) if (arr[i] === '8') out += '7222';
for (var i = 0; i < n; i++) if (arr[i] === '5') out += '5';
for (var i = 0; i < n; i++) if (arr[i] === '6') out += '53';
for (var i = 0; i < n; i++) if (arr[i] === '3') out += '3';
for (var i = 0; i < n; i++) if (arr[i] === '4') out += '322';
for (var i = 0; i < n; i++) if (arr[i] === '2') out += '2';

}

print(out);


var str[];
var line = readline().split(' ');
var F = parseInt(line[0]), I = parseInt(line[1]), T = parseInt(line[2]);
for (var i = 0; i < F; i++) str[i] = readline();
var ans = 0;
	for (var j = 0; j < I; j++){
		var cnt = 0;
		for (var i = 0; i < F; i++) if (str[i][j] == 'Y') cnt++;
		if (cnt >= T) ans++;
	}
print(ans);


var tiles = readline().split(" ");

if (isKoutsu(tiles) || isShuntsu(tiles))
    print("0")
else {
    var koutsuRepairCount = correctForKoutsu(tiles);
    var shuntsuRepairCount = correctForShuntsu(tiles);

    print(Math.min(koutsuRepairCount, shuntsuRepairCount));
}

/***************************************************************************/
/***************************************************************************/
/***************************************************************************/
function isKoutsu(tiles) {
    return (tiles[0] === tiles[1] && tiles[1] === tiles[2]);
}

function isShuntsu(tiles) {
    tiles.sort();
    return isSameSuit(tiles[0], tiles[1], tiles[2]) && isSequential(tiles[0], tiles[1], tiles[2]);
}

function isSameSuit(tile1, tile2, tile3) {
    return (tile1.charAt(1) == tile2.charAt(1) && tile2.charAt(1) == tile3.charAt(1));
}

function isSequential(tile1, tile2, tile3) {
    var diff1 = Math.abs(parseInt(tile1.charAt(0)) - parseInt(tile2.charAt(0))) == 1;
    var diff2 = Math.abs(parseInt(tile2.charAt(0)) - parseInt(tile3.charAt(0))) == 1;

    return diff1 && diff2;

}

function correctForShuntsu(tiles) {

    var groups = {};

    tiles.forEach(function (tile) {
        var suit = tile.charAt(1);
        var digit = parseInt(tile.charAt(0));

        if (!groups.hasOwnProperty(suit)) {
            groups[suit] = [];
        }
        groups[suit].push(digit);
        groups[suit].sort();
    });

    let consecutive = false;

    for (const [suit, digits] of Object.entries(groups)) {
        if (digits.length == 2) {
            //consecutive = (Math.abs(digits[0] - digits[1]) == 1) || (Math.abs(digits[0] - digits[1]) == 2);
            consecutive = true;
        }
    }

    return consecutive ? 1 : 2;
}

function correctForKoutsu(tiles) {

    var set = new Set(tiles);
    var len = set.size;

    return (len == tiles.length) ? 2 : (tiles.length - len);

}


var r = readline().split(' ');
var a=r[0];
var b=r[1];
var sum = a;
while(a>=){
    a=a/b;
    sum= sum +a ;
}
print(sum+1);


var input = readline();
function main(pos) {
  let one = pos[0];
  let two = pos[1];
	if(['a', 'h'].includes(one) && ['1', '8'].includes(two)) {
    return 3;
  }

  if(['a', 'h'].includes(one) || ['1', '8'].includes(two)) {
    return 5;
  }

  return 8;
}
print(main(input));


var s = readline();
var t = readline();

s = s.split('');
t = t.split('');

function equal(var a, var b) {
    var i = 0;

    for (i in a)
    {
        if (!(b.hasOwnProperty(i) && a[i] === b[i])) {
            return false;
        }
    }
    return true;
}

var cnt = 0;
var i = 0;

for (i = s.length-1; i >= 0; --i) {

    var code = s[i].charCodeAt();

    if (code === 'z'.charCodeAt()) {
        s[i] = 'a';
    }
    else {
        s[i] = String.fromCharCode(code+1);
        break;
    }
}

if (s === t ){
    print("No such string");

}
else print(s.join(''));


var r = readline();
//sorting the array in an ascending order
var puzzles_pieces = readline().split(" ").sort(function(a, b){return a-b});
//var modified = puzzles_pieces;
puzzles_pieces = puzzles_pieces.filter(function(a,b){a==b return puzzles_pieces.remove(b)})
// for(i = 0; i < puzzles_pieces; i++){
// 	if(puzzles_pieces[i] === puzzles_pieces[i+1]){
// 		modified = puzzles_pieces.remove(puzzles_pieces[i])
// 	}
// }
var minDiff = puzzles_pieces[1] - puzzles_pieces[0];
for(i = 2; i < puzzles_pieces.length; i++){
	//using the comparsion Math.min() offers with fixed value
	//while iterating on the remaining portion of the array
	//to achieve the minimum difference needed.
	minDiff = Math.min(minDiff, puzzles_pieces[i]-puzzles_pieces[i-1]);
}
print(minDiff);


var r = readline();

var puzzles_pieces = +readline();
//sorting the array in an ascending order
var sorted = puzzles_pieces.sort(function(a,b){return a-b});
var new_sorted;

for(i = 0; i < sorted.length; i++){
	new_sorted = sorted.map(function(a,b){a===b return sorted.remove(b)})
}

var minDiff = new_sorted[1] - new_sorted[0];
for(i = 2; i < sorted.length; i++){
	//using the comparsion Math.min() offers with fixed value
	//while iterating on the remaining portion of the array
	//to achieve the minimum difference needed.
	minDiff = Math.min(minDiff, a[i]-a[i-1]);
}
print(minDiff);


var s=String(readline());
var num=[];
var res=[];
for(let i=0;i<s.length;i++){
  num.push(parseInt(s[i]));
}
while(true){
  var tmps=""
  for(let i=0;i<num.length;i++){
      v=num[i];
    if (v > 0){
      num[i]-=1
      tmps+="1"
    }else{
      tmps+="0"
	}
  }
  res.push(parseInt(tmps))
  if(num.every(function(elem){return elem==0;})){
    break;
  }
}
print (res.length)
print (res.join(" "))


const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let line = 0;
let count;
let years = [];
const calc = () => {
    let x = Math.max.apply(null, years.map(function(el) {
        return Math.min.apply(null, years.map(function(year) {
            let delta = Math.abs(parseInt(year) - parseInt(el));
            return delta > 0 ? delta : Infinity;
        }));
    }));
    console.log(years.filter(function(el) {
        let year = years.reduce(function(prev, cur) {
            if (Math.abs(el - parseInt(cur)) <= x) {
                return prev && true;
            } else {
                return prev && false;
            }
        }, true);
        if (year) return el;
    })[0]);
    process.exit();
};

rl.on('line', function(input) {
    if (line === 0) {
        count = input;
        line++;
    } else {
        years = input.split(' ');
        calc();
    }
});


let readline = global.readline === undefined ? require('readline') : readline;
let print = global.print || console.log;

const data = [];
if (process.env.NODE_ENV === 'local') {
  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    terminal: false
  });

  rl.on('line', (line) => {
    data.push(line)
  });

  rl.on('close', solve);
} else {
  let line;
  while(line = readline()) {
    data.push(line);
  }
  solve();
}

function save(result) {
    print(result);
}

function solve() {
  const n = parseInt(data[0]);
  const dates = data[1].split(' ').map(d => parseInt(d)).sort((a, b) => a - b);

  const result = dates[Math.round(n / 2)];
  save(result);
}


const data = [];

let line;

while(line = readline()) {
    data.push(line);
}

solve();

function save(result) {
    print(result);
}

function solve() {
  const n = parseInt(data[0]);
  const dates = data[1].split(' ').map(d => parseInt(d)).sort((a, b) => a - b);

  const result = dates[Math.round(n / 2)];
  save(result);
}


var [ n, ...abc ] = readline().split(' ').map(Number);
l = abc.reduce((r, i) => r.includes(i) ? r : [ ...r, i ], []).sort((a, b) => a - b);

function ribbon(n, l) {
    if (n === 0) return 0;
    if (n < 0) return false;
    for (var i = 0; i < l.length; i++) {
        var x = ribbon(n - l[i], l);
        if (typeof x === 'number') return 1 + x;
    }
}
print(ribbon(n, l));


const [ n, a, b, c ] = readline().split(' ').map(Number);
const l = [a, b, c].slice(1).reduce((r, i) => r.includes(i) ? r : [ ...r, i ], []).sort((a, b) => a - b);

function ribbon (n, l) {
    if (n === 0) return 0;
    if (n < 0) return false;
    for (let i = 0; i < l.length; i++) {
        const x = ribbon(n - l[i], l);
        if (typeof x === 'number') return 1 + x;
    }
}

print(ribbon(n, l));


const nabc = readline().split(' ').map(Number);
const n = nabc[0];
const l = nabc.slice(1).reduce((r, i) => r.includes(i) ? r : [ ...r, i ], []).sort((a, b) => a - b);

function ribbon (n, l) {
    if (n === 0) return 0;
    if (n < 0) return false;
    for (let i = 0; i < l.length; i++) {
        const x = ribbon(n - l[i], l);
        if (typeof x === 'number') return 1 + x;
    }
}

print(ribbon(n, l));


var numberStr = readline().split(" ")[0];
// var numberStr = ["99"][0];

function check(numberStr) {
    let digits = numberStr.split("");
    let sum = digits.reduce(function (a, b) {return (+a) + (+b)}, 0);
    return sum%4;
}

while (check(numberStr)) {
    var nun = +numberStr;
    nun++;
    numberStr = String(nun);
}

// console.log(numberStr);
print(numberStr);


let numbers = readline().split(" ").map(function(x) { return parseInt(x); });

// let numbers = [99]

let digits = String(numbers[0]).split("");

function check(digits) {
    let sum = digits.reduce((a, b) => +a + +b);
    return sum%4;
}

while (check(digits)) {
    let nun = parseInt(digits.join(""));
    nun++;
    digits = String(nun).split("");
}

let result = digits.join("");

// console.log(result);

write(result);


var numberStr = readline().split(" ")[0];
// var numberStr = ["99"][0];

function check(numberStr) {
    let digits = numberStr.split("");
    let sum = digits.reduce((a, b) => {return (+a) + (+b)}, 0);
    return sum%4;
}

while (check(numberStr)) {
    var nun = +numberStr;
    nun++;
    numberStr = String(nun);
}

// console.log(numberStr);
print(numberStr);


let numbers = readline().split(" ").map(function(x) { return parseInt(x); });

let digits = String(numbers[0]).split("");

function check(digits) {
    let sum = digits.reduce((a, b) => +a + +b);
    return sum%4;
}

while (check(digits)) {
    let nun = parseInt(digits.join(""));
    nun++;
    digits = String(nun).split("");
}

let result = parseInt(digits.join(""));

print(result);


var numbers = readline().split(" ").map(function(x) { return parseInt(x); });

// var numbers = [99];

let digits = String(numbers[0]).split("");

function check(digits) {
    let sum = digits.reduce((a, b) => +a + +b);
    return sum%4;
}

while (check(digits)) {
    var nun = parseInt(digits.join(""));
    nun++;
    digits = String(nun).split("");
}

var result = digits.join("");

// console.log(result);

print(result);


print(solution(readline());

// End of interface

function solution(n){
	var res = 0;
	for (var i=1; i<n; i++){
		if (n % i === 0){
			res++;
		}
	}
	return res;
};


<script>
var a = +prompt ("", "");
var b = +prompt ("", "");
var ycr = +prompt ("", "");;
var gcr = +prompt ("", "");;
var bcr = +prompt ("", "");;
var sum = 0, S1, S2;

S1 = ycr * 2 + gcr;
S2 = bcr * 3 + gcr;

if (a < S1) {
sum = sum + (S1 - a);
};

if (b < S2) {
sum = sum + (S2 - b);
}

alert (sum);
</script>


var str=readline().split(" ");
str.sort();
var x = 1;
var strEnd = [];
for(var i in str) {
    if(str[i]==str[i-1]) {x++;
                            if (x==4) for (j=0;j<x;j++) delete str[i-j];
                            //console.log (i + ": "+ str + " x = " + x)}
    else x=1
            }

for(var i in str) strEnd.push(str[i]);
if (x>3){
    if (strEnd[0]==strEnd[1]) print("Elephant");
    else print ("Bear");
    }
else print("Alien");


let n= readline();
if (n%2 === 0){
    print('mahmound');
}else{
    print('ehab');
}


import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;
import java.util.SortedSet;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {

    public static void main(String[] args) throws FileNotFoundException {
        //InputStream inputStream = new FileInputStream("bluetube.in");//System.in;
        //OutputStream outputStream = new FileOutputStream("bluetube.out");//.out;
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(in, out);
        out.close();
    }
}

class Solver {

    public void solve(InputReader in, PrintWriter out) {
        BigInteger a = new BigInteger(in.next());
        BigInteger b = new BigInteger(in.next());
        out.print(a.add(b));
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public long nextLong() {
        return Long.parseLong(next());
    }
    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


function main() {

var line = readline().split(' ')
print(parseInt(line[0]) + parseInt(line[1]))

main();


var inp = readline();

let count4 = inp.match(/4/g);
let count7 = inp.match(/7/g);

if (count4) {
    if (count7) {
        if (count4.length >= count7.length) {
            print(4);
        } else {
            print(7);
        }
    }
} else if(count7) {
    print(7);
} else {
    print(-1);


function binStr(bs) {
  if (bs.length < 7) return "no";
  let tot = 0;
  for (let i = bs.length-1, j = 0; i >= 0; i--, j++) {
    tot += bs[i] * Math.pow(2, j);
  }
  if (tot <= 64) return "no";
  return "yes";
}

console.log(binStr('100010001'));


function div64(strn) {
  if (strn.length < 7)
    return 'no'
  // 1000000 === 64
  var zeros = 0
  for (let i = strn.length - 1; i >= 0; i--)
    if (strn[i] === '1' && zeros >= 6)
      return 'yes'
    else if (strn[i] === '0')
      zeros++
  return 'no'
}

var strn = readline()
print(div64(strn))


let index = 0;
let arrData = [];
process.stdin.on('data', function(data) {
    arrData.push(data.toString());
    if(++index == 2) {
        console.log(count(arrData[0], arrData[1]));
    }
});

function count(daysCount, days) {
    let sToFArr = days.match( /SF/ig );
    let fToSArr = days.match( /FS/ig );
    let fToS = (fToSArr || []).length;
    let sToF = (sToFArr || []).length;
    return sToF > fToS ? 'YES' : 'NO';
}


'use strict'

const fn = (x) => {
    const s = x.reduce((r, i) => r + i, 0);
    if (s % 2) return 'NO';

    for (let i = 0; i < 4; i++) {
        if (x[i] === s / 2) return 'YES';
        if (x[i] > s / 2) continue;
        for (let j = i + 1; j < 4; j++) {
            const t = x[i] + x[j];
            if (t === s / 2) return 'YES';
            if (t > s / 2) continue;
            for (let k = j + 1; k < 4; k++) {
                if (t + x[k] === s / 2) return 'YES';
                if (t + x[k] > s / 2) continue;
            }
        }
    }
    return 'NO';
}

write(fn(readline().split(' ').map(Number);))


var n = parseInt(readline());
var integers = readline().split(' ').map(x => parseInt(x));
var ones = 0, zeros = 0, max = 0;
let maxSequence = [];
for (var i = 0; i < n; i++) {
  if (integers[i] === 1) zeros++, ones--;
  else ones++;
  if (ones < 0) ones = 0;
  max = Math.max(max, zeros);
}
if (zeros === n) print(n - 1);
else print(max + ones);


var y = readline();
var sB = readline();

var a = y.split(' ');
var aB = a[0];
var lG = a[1];

var x = cH(lG, sB);
print(x);

function cH(lG,sB) {
    var aSB = sB.split(' ');
    var res = 0;

    for (let i = 0 ; i<aSB.length; i++) {
        var hours = lG/aSB[i];
        if ((hours^0) === hours && 0 < hours && hours < result ) {
          res = hours;
        }
    }
    return res;
}


var data = readline();
var speedBuckets  =  readline();

var a = data.split(' ');
var amountBuckets = a[0];
var lengthGarden = a[1];

print(calculateHours(lengthGarden, speedBuckets));

function calculateHours(lengthGarden,speedBuckets) {
    var arrSpeedBuckets = speedBuckets.split(' ');
    var result = Infinity;

    for (let i = 0 ; i<arrSpeedBuckets.length; i++) {
        var hours = lengthGarden/arrSpeedBuckets[i];
        if ((hours^0) === hours && 0 < hours && hours < result ) {
          result = hours;
        }
    }
    return result;
}


var arr = readline().split(' ');
var arrSpeedBuckets = readline().split(' ');

var amountBuckets = 6;/*arr[0];*/
var lengthGarden = 4;/*arr[1];*/

var result = Infinity;
for (let i = 0; i < arrSpeedBuckets.length; i++) {
    var hours = lengthGarden / arrSpeedBuckets[i];
    if ((hours ^ 0) === hours && 0 < hours && hours < result) {
        result = hours;
    }
}
print(result);


var n,m,x;
var cnt=new Array(1024);

for(var i=0;i<=1000;i++) cnt[i]=new Array(3);

var line = readline().split('');

n=line[0];
m=line[1];

for(var i=0;i<n;i++){
    line = readline();
    cnt[i%m][line[0]]++;
}

var ans=0;

for(int i=0;i<m;i++){
    ans+=min(cnt[i][1],cnt[i][2]);
}

print(ans);


var n,m,x;
var cnt[N][5];

var line = readline().split('');
n=line[0];
m=line[1];

for(var i=0;i<n;i++){
    line = readline();
    cnt[i%m][line[0]]++;
}

var ans=0;

for(int i=0;i<m;i++){
    ans+=min(cnt[i][1],cnt[i][2]);
}

print(ans);


function getOutput(n, a, x, b, y) {
    const maxNumberOfSteps = n;
    for (let currentMinute = 0; currentMinute < maxNumberOfSteps; currentMinute++) {
        let danielCurrentStation = (a + currentMinute) % maxNumberOfSteps;
        if (danielCurrentStation === 0) {
            danielCurrentStation = n;
        }
        let vladCurrentStation = (b - currentMinute) % maxNumberOfSteps;
        if (vladCurrentStation < 0) {
            vladCurrentStation = n + vladCurrentStation;
        }
        if (vladCurrentStation === 0) {
            vladCurrentStation = n;
        }
        if (danielCurrentStation === vladCurrentStation) {
            return 'YES';
        }
        if (danielCurrentStation === x || vladCurrentStation === y) {
            break;
        }
    }
    return 'NO';
}

function main() {
    let line = readline().split(' ');
    let [n, a, x, b, y] = line.map(x => parseInt(x));
    console.log(getOutput(n, a, x, b, y));
}

main();


function getAns(k,l,m,n,d){
    var dead = new Array(d+2);
    for (let i=1;i<=d;i++)
        dead[i]=false;
    var ans=0;
    for (let i=1;i<=d;i++){
        if (i%k===0||i%l===0||i%m===0||i%n===0){
            if (dead[i]===false){
                ans++;
                dead[i]=true;
            }
        }
    }
    return ans;
}

var input=readline().split(' ');
var k=+input[0],l=+input[1],m=+input[2],n=+input[3],d=+input[4];
print(getAns(k,l,m,n,d));


function fat(n) {
  let res = 1;
  for(let i = 2; i <= n; i++) res=res*i;
  return res;
}

function main(){
  let numbers = readline().split(" ").map(function(x) { return parseInt(x); });
  let a = numbers[0], b = numbers[1]
  // print(a,b);
  let res;
  if(a <= b) res = fat(a);
  else res = fat(b);
  print(res);
}

main()


function fat(n) {
  let res = 1;
  for(let i = 2; i <= n; i++) res=res*i;
  return res;
}

function main(){
  // let numbers = readline().split(" ").map(function(x) { return parseInt(x); });
  // let a = numbers[0], b = numbers[1]
  // // print(a,b);
  // let res;
  // if(a <= b) res = fat(a);
  // else res = fat(b);
  // print(res);
  // return res;
}

main()


function bla(n) {
  let res = 1;
  for(let i = 2; i <= n; i++) res=res*i;
  return res;
}

function main(){
  // let numbers = readline().split(" ").map(function(x) { return parseInt(x); });
  // let a = numbers[0], b = numbers[1]
  // // print(a,b);
  // let res;
  // if(a <= b) res = bla(a);
  // else res = bla(b);
  // print(res);
  // return res;
}

main()


var line = readline();
var minjmp = 0;
var idx = -1;

function isVowel(chr) {
    ch = chr.toLowerCase();
    return ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u';
}

for (let i = 0; i < line.length; i++) {
    if (isVowel(line.charAt(i))) {
        minjmp = Math.max(minjmp, i - idx);
        idx = i;
    }
}

console.log(minjmp);


<!DOCTYPE HTML>

������ ���������...

...����� ���������


var str = /readline();
//var str = "100 100 100";
str = str.split(" ");
var y = parseInt(str[0]);//8
var b = parseInt(str[1]);//13
var r = parseInt(str[2]);//9
var peque = '';

if (y < b && y+1<r) {
    //alert(y + " es el más pequeño");
    peque = y;
} else if (b < r-1) {
    //alert(b + " es el más pequeño");
    peque = b;
} else {
    //alert(r + " es el más pequeño");
    peque = r;
}

if (peque == y) {
    if (y > 98) {
        y = 98;
    }
    //alert("peque=Y")
    b = y + 1;
    r = b + 1;
} else if (peque == b) {
    //alert("peque=B")
    y = b - 1;
    r = b + 1;
} else if (peque == r) {
    //alert("peque=R")
    b = r - 1;
    y=r-2;
}
print(y+b+r)


var t = readline().split(' ')
var y = t[0]
var b = t[1]
var r = t[2]
var res = r;

if b < (r-1) then res = b + 1;
res = res + b;

if y < (b-1) then res = y+1 + y+2;
res = res + y;

write(res);


 var num  = readLine().split(' ').map(a=>parseInt(a))
 var n = num[0]
 var m = num[1]
   var count = 0
   var target = n+m
   for(var i = 0;i<=n+m;i++){
       for(var j = 0;j<=n+m;j++){
           if(i**2+j == n && j**2+i == m){
               count++
           }
       }
   }
    print(count)


var  input=readline();

var m= input.split(' ')[0]
var n= input.split(' ')[1]

if(n%m!==0) {
print(-1)

}
 let count= 0;
let divided =n/m
reqursion(divided)
print(count)

function reqursion(divided) {
if(divided===1) {return}
if(divided%3===0) {
count++;
reqursion(divided/3)
return
}
if(divided%2===0) {
count++;
reqursion(divided/2)
return
}
print(-1)
return
}


var  input=readline();
function reqursion(divided) {
if(divided===1) {print(count)}
if(divided%3===0) {
count++;
reqursion(divided/3)

}
if(divided%2===0) {
count++;
reqursion(divided/2)

}
print(-1)

}
var m= input.split(' ')[0]
var n= input.split(' ')[1]

if(n%m!==0) {
print(-1)

}
 let count= 0;
let divided =n/m


var  input=readline();

var m= input.split(' ')[0]
var n= input.split(' ')[1]

if(n%m!==0) {
print(-1)

}
 let count= 0;
let divided =n/m
print(7)


const [startingCount, divider, priceToBuild, priceToDemolish] = readline().split(" ").map((x) => +x)
const toDemolish = startingCount % divider;
const toBuild = divider - toDemolish;
print(Math.min(toDemolish * priceToDemolish, toBuild * priceToBuild))


var m = readline().split('');

var r = 0;

for (let i of m){

    if('0123456789'.indexOf(i) != -1){
        if(i % 2 == 0){
            r++;
        }
        continue;
    }

    if('aeiou'.indexOf(i) != -1){
        r++;
    }
}

print(r);


var BigInteger = require('jsbn').BigInteger;

function main() {
  var nums = readline().split(' ');
  var decimal = `${String(
    new BigInteger(Number(nums[0])).divide(new BigInteger(Number(nums[1]))),
  ).slice(2)}0`;
  var c = nums[2];

  // console.log('decimal', decimal);
  // console.log(decimal.indexOf(c));

  print(decimal.indexOf(c) + 1);
}

main();


const line = readline();
const numb = Number.parseInt(line);
let i = 1;
let res = 0;
while (i <= Math.pow(10, 9)) {
    i & numb && res++;
}
print(res);


var line = readline().split(' ');
// print(parseInt(line[0]) + parseInt(line[1]));

// let line = '1 1 1'.split(' ');
let a = parseInt(line[0]);
let b = parseInt(line[1]);
let c = parseInt(line[2]);
let answ = c * 2 + 2 * Math.min(a, b) + (a !== b ? 1 : 0);
print(answ);
// console.log(answ);


var [n, a, b] = readline().split(" ").map( (x) => parseInt(x));
print(n);


let a = +readLine();
if(a % 2 === 0){
    print(Math.pow(a/2, 2));
}
else{
    print(0);
}


let [n, x] = readline().split(' ').map(s=>+s);
let vs = readline().split(' ').map(s=>+s);
print(new Array(x)
    .fill(0)
    .map((_,i) => vs.includes(i) ? 0 : 1)
    .reduce((a, b) => a + b, 0)
    + (vs.includes(x) ? 1 : 0));


const SPLIT_BY_SPACE = function(line) {
    return line.split(' ');
};
const STRING_LINE = function(line) {
    return line;
}
function getInput(...parseLineFunc) {
    let line = readline();
    let iFunc = 0;
    let data = [];
    parseLineFunc = parseLineFunc || [];

    do{
        let func = parseLineFunc[iFunc] || SPLIT_BY_SPACE;
        data[iFunc] = func(line);
        line = readline();
        iFunc++;
    }
    while(line);
    return data;

};
function solution() {
    let data = getInput(SPLIT_BY_SPACE, STRING_LINE);
    let N = parseInt(data[0]);
    let S = data[1];
    let maps = {};
    for (let s of S) {
        if (maps[s]) {
            print('Yes');
            return;
        }
        maps[s] =  true;
    }
    print('No');
    return;
}

solution();


var arr = readline().split(' ');
var len = Number(arr[0]);
arr = readline().split(' ');

var str = arr[0];
var num_in_p = 0;
var max_len = 0;
var tmp_len = 0;
var p_flag = false;
var s_flag = false;

for (var i = 0;i < str.length;i ++) {
	if (!s_flag && !p_flag && helper(str[i]) == -1) {
		tmp_len ++;
		s_flag = true;
	} else if (s_flag && !p_flag && helper(str[i]) == -1) {
		tmp_len ++;
	} else if (helper(str[i]) != -1 && !p_flag) {
		s_flag = false;
		max_len < tmp_len ? max_len = tmp_len : null;
		tmp_len = 0;
	}
	if (!p_flag && helper(str[i]) == 1) {
		p_flag = true;
	} else if (p_flag && helper(str[i]) == 2) {
		p_flag = false;
	}

	if (p_flag && helper(str[i]) == -1 && !s_flag) {
		s_flag = true;
	} else if (p_flag && s_flag && helper(str[i]) != -1) {
		num_in_p ++;
		s_flag = false;
	}
}
max_len < tmp_len ? max_len = tmp_len : null;

print(max_len);
print(num_in_p);

function helper(_c) {
	if (_c == '_') {
		return 0;
	} else if (_c == '(') {
		return 1;
	} else if (_c == ')') {
		return 2;
	} else {
		return -1;
	}
}


var arr = readline().split(' ');
var len = Number(arr[0]);
arr = readline().split(' ');

var str = arr[0];
var num_in_p = 0;
var max_len = 0;
var tmp_len = 0;
var p_flag = false;
var s_flag = false;

for (var i = 0;i < str.length;i ++) {
	if (!s_flag && !p_flag && helper(str[i]) == -1) {
		tmp_len ++;
		s_flag = true;
	} else if (s_flag && !p_flag && helper(str[i]) == -1) {
		tmp_len ++;
	} else if (helper(str[i]) != -1 && !p_flag) {
		s_flag = false;
		max_len < tmp_len ? max_len = tmp_len : null;
		tmp_len = 0;
	}
	if (!p_flag && helper(str[i]) == 1) {
		p_flag = true;
	} else if (p_flag && helper(str[i]) == 2) {
		p_flag = false;
	}

	if (p_flag && helper(str[i]) == -1 && !s_flag) {
		s_flag = true;
	} else if (p_flag && s_flag && helper(str[i]) != -1) {
		num_in_p ++;
	}
}
max_len < tmp_len ? max_len = tmp_len : null;

print(max_len);
print(num_in_p);

function helper(_c) {
	if (_c == '_') {
		return 0;
	} else if (_c == '(') {
		return 1;
	} else if (_c == ')') {
		return 2;
	} else {
		return -1;
	}
}


var arr = readline().split(' ');
var len = Number(arr[0]);
arr = readline().split(' ');

var str = arr[0];
var num_in_p = 0;
var max_len = 0;
var tmp_len = 0;
var p_flag = false;
var s_flag = false;

for (var i = 0;i < str.length;i ++) {
	if (!s_flag && !p_flag && helper(str[i]) == -1) {
		tmp_len ++;
		s_flag = true;
	} else if (s_flag && !p_flag && helper(str[i]) == -1) {
		tmp_len ++;
	} else if (helper(str[i]) != -1 && !p_flag && s_flag) {
		s_flag = false;
		max_len < tmp_len ? max_len = tmp_len : null;
		tmp_len = 0;
	}
	if (!p_flag && helper(str[i]) == 1) {
		p_flag = true;
	} else if (p_flag && helper(str[i]) == 2) {
		p_flag = false;
	}

	if (p_flag && helper(str[i]) == -1 && !s_flag) {
		s_flag = true;
		num_in_p ++;
	} else if (p_flag && s_flag && helper(str[i]) != -1) {
		s_flag = false;
	}
}
max_len < tmp_len ? max_len = tmp_len : null;

print(max_len);
print(num_in_p);

function helper(_c) {
	if (_c == '_') {
		return 0;
	} else if (_c == '(') {
		return 1;
	} else if (_c == ')') {
		return 2;
	} else {
		return -1;
	}
}


readline();
var input = readline() + '(_)_';
print([
    Math.max(...input.replace(/[(][a-z_]*[)]/gi, '_').split('_').map(el => el.length)),
    input.match(/[(][a-z_]*[)]/gi).map(el => el.split(/[()_]/gi).filter(el => el.length)).map(el => el.length).reduce((a, b) => a + b)
].join(' '));


(function () {
    var read = {
        number: function () {
            return +readline();
        },
        arr: function (divider) {
            return readline().split(divider ? divider : '');
        },
        arrNumber: function (divider) {
            return readline()
                .split(divider ? divider : '')
                .map(item => +item);
        }
    }

    var n = read.number();
    var a = [...new Set(read.arrNumber(' '))];

    var max = a[0], min = a[0];
    a.forEach(i => {
        if(i > max) max = i;
        if(i < min) min = i;
    });

    mid = min + (max - min)/2

    var midUse = false;
    var minuse = false;
    var maxuse = false

    for(var f = 0; f < a.length; f++) {
        var i = a[f]
        if(i === mid) {
            midUse = true;
        }
        else if(i === max) {
            minuse = true;
        }
        else if(i === min) {
            maxuse = true;
        }
        else {
            print(-1);
            return;
        }
    }

    if(midUse) {
        print(max - mid)
    }
    else {
        if((max - min) %2 === 1)
            print(max - min);
        else {
            print((max - min) / 2)
        }
    }
}());


'use strict';

const fs = require('fs');

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.replace(/\s*$/, '')
        .split('\n')
        .map(str => str.replace(/\s*$/, ''));

    main();
});

function readLine() {
    return inputString[currentLine++].split(' ');
}

function readInt(s) {
    return parseInt(s, 10);
}

function readIntArray(a) {
    return a.map(e => parseInt(e, 10));
}

function solve(n, ar) {
    ar.sort((a, b) => a - b);
    let ans = (ar[n - 1] - ar[0]) % 2 === 0 ? (ar[n - 1] - ar[0]) / 2 : -1;
    for (let i = 0; i < n; i++) {
        if (ar[i] !== ar[0] && ar[i] !== ar[n - 1] && ar[i] !== ar[0] + ans) ans = -1;
    }
    if (ans === -1) {
        ans = ar[n - 1] - ar[0];
        for (let i = 0; i < n; i++) {
            if (ar[i] !== ar[0] && ar[i] !== ar[n - 1]) ans = -1;
        }
    }

    return ans;
}

function main() {

    const nk = readLine();

    const n = readInt(nk[0]);
    const a = readIntArray(readLine());

    let result = solve(n, a);
    console.log(result);
}


var n=readline();
var arry=readline().split(' ');

function uniqueArr(arr) {
  var output=[];

  for (var i = 0; i < arr.length; i++) {
    var counter = 0;

    for (var j = 0; j < output.length; j++) {
      if ( arr[i] == output[j] ) {
        counter++;
      }
    }

    if (counter == 0) output.push(arr[i]);
  }

  for (var x = 0; x < output.length - 1; x++) {
    var minNum = output[x], index = x, old = output[x];

    for (var k = x + 1; k < output.length; k++) {
      if (minNum > output[k])  {
        index = k;
        minNum = output[k];
      }
    }

    output[x] = minNum;
    output[index] = old;
  }

  return output;
}

function findD(arr) {
  arr = uniqueArr(arr);

  if (arr.length == 1) {
    return 0;
  }

  else if (arr.length == 2) {
    var D = Math.abs( (arr[0] - arr[1])/2 );
    if ( D == Math.floor(D) ) {
      return D;
    }else return Math.abs(arr[0] - arr[1]);
  }

  else if (arr.length == 3) {
    var D1 = Math.abs(arr[0] - arr[1]), D2 = Math.abs(arr[0] - arr[2]);
    if ( D1 == D2 || 2*D1 == D2) {
      return D1;
    }
    else if (D1 == 2*D2) {
      return D2;
    }
    else return -1;
  }

  return -1;
}

print( findD(arry) )


var line = readline().split(' ');
var n = parseInt(line[0]);
var v = parseInt(line[1]);
var arr = readline().split(' ');
var a = [];
var cur = [];
var sum = 0;
for (var i = 0; i < arr.length; i ++)
{
    a[i] = parseInt(arr[i]);
    cur[i] = a[i]%2===0?a[i]/2:parseInt(a[i]/2)+1;
    sum += cur[i];
}
if (sum > v)
{
    print(-1);
}
while(v-sum > 0)
{
    var max = 0;
    var maxi = 0;
    for (var i = 0; i < a.length; i ++)
    {
        if (a[i] > max && cur[i]!=a[i])
        {
            max = a[i];
            maxi = i;
        }
    }
    var put = Math.min(Math.min(v-sum), (a[maxi]-cur[maxi]));
    cur[maxi]+=put;
    sum+=put;
}

print( cur.join(" ") );


  var tmp = readline().split(' ').map(x => parseInt(x));
  var n = tmp[0];
  var w = tmp[1];
  var a = readline().split(' ').map(x => parseInt(x));
  var idx = new Array(n).fill(0).map((x, i) => i).sort((x, y) => a[y] - a[x]);
  var res = [];
  var sum = 0;
  var sumC = 0;
  for(var i = 0; i < n; i += 1) {
    res[i] = (a[i] + 1) / 2 | 0;
    sum += res[i];
    sumC += a[i];
  }
  // console.log(sum, sumC, res)
  if(sum > w || sumC < w) {
    print(-1);
  } else {
    var r = w - sum;
    var k = 0;
    while(r > 0) {
      if(a[idx[k]] - res[idx[k]] < r) {
        r -= a[idx[k]] - res[idx[k]];
        res[idx[k]] = a[idx[k]];
      } else {
        res[idx[k]] += r;
        r -= r;
      }
      k += 1;
    }
    print(res.join(' '));
  }


var line = readline().split(' ');
var n = line[0];
var a = line[1];

if (a % 2) {
	var house = a;
} else {
	var house = n - a;
}

var res = Math.floor(house/2) + 1;

print(res);


var data = readline().split(" "),
	n = data[0],
	a = data[1];

var homes = [];

for(let i=0;i<n;i++){
	homes.push(i+1);
}

if( a%2 == 0 ){
	homes = homes.filter(v=>(v%2==0));

	for( let i=0; i<homes.length; i++ ){
		if( homes[i] == a ) print(i+2);
	}
} else {
	homes = homes.filter(v=>(v%2!=0)).reverse();

	for( let i=0; i<homes.length; i++ ){
		if( homes[i] == a ) print(i+2);
	}
}


    var n = readline();
    var a = readline().split(" ").map(x=> parseInt(x));
    a.sort((x,y) => x-y);

    let c = 0;
    for(let i=0;i<n;++i){
        if(a[i]){
            let tmp = a[i];
            for(let j=i;j<n;++j){
                if(a[j]%tmp==0)
                    a[j]=0;
            }
            c++;
        }
    }
    console.log(c);


var n = readline();
var a = readline().split(" ").map(x=> parseInt(x));
a.sort((x,y) => x-y);

var c = 0;
for(var i=0;i<n;++i){
    if(a[i]){
        var tmp = a[i];
        for(var j=i;j<n;++j){
            if(a[j]%tmp==0)
                a[j]=0;
        }
        c++;
    }
}
print(c);


var ns = function (a,b) {
    return a - b;
};
var w = readline();
var a = readline().split(" ");
a.sort(ns);
var c = 0

for (var i = 0; i < a.length; i++){
    var count = 0;
    for (var j = i-1; j >= 0; j--){
        if (a[i]%a[j] == 0){
            count++;
            break;
        }
    }
   if (count == 0){
       c++;
   }
};
write(c);


(function() {
var INPUT = ``;
var OUTPUT = ``;

var main = function() {"use strict";
    // TODO
    var n = rdN();
    var A = rdArN().sortLt();
    var W = crAr(n, false);
    var res = 0;
    for (var i = 0; i < n; ++i) {
        if (!W[i]) {
            for (var j = i+1; j < n; ++j) {
                if (A[j]%A[i] === 0) {
                    W[j] = true;
                }
            }

            ++res;
        }
    }
    wr(res);
};

if(INPUT){INPUT=INPUT.split('\n').reverse();
readline=()=>INPUT.pop();
write=(...s)=>{OUTPUT+=[...s].join(' ')};
print=(...s)=>{write(...s);OUTPUT+='\n'};}
const
rdS=readline,
rdN=()=>+rdS(),
rdArS=()=>rdS().split(' '),
rdArN=()=>rdArS().map(v=>+v),
wr=write,
pr=print,
prAr=(a)=>pr(...a),
prOb=(o)=>pr(JSON.stringify(o,null,4)),
crAr=function(length,...fillArgs){return new Array(length).fill(...fillArgs);},
getPrimes=function(n){var sieve=crAr(n+1,true),primes=[],i,j;for(i=2,j=4;j<sieve.length;j=Math.pow(++i,2)){if(sieve[j]){for(;j<sieve.length;j+=i){sieve[j]=false;}}}for(i=2;i<sieve.length;++i){if(sieve[i]){primes.push(i);}}return primes;},
getPrimeFactors=function(n){var primes=getPrimes(Math.floor(Math.sqrt(n))),last=primes.push(n)-1,factors=[],i,p;for(i=0,p=primes[0];primes[last]>1;){if(primes[last]%p===0){primes[last]/=p;factors.push(p);}else{p=primes[++i];}}return factors;},
defineProperty=(o,pN,v)=>Object.defineProperty(o,pN,{value:v,writable:true,enumerable:false,configurable:true});
defineProperty(Array.prototype,'sortLt',function(){return this.sort((a,b)=>a-b);});
defineProperty(Array.prototype,'sortGt',function(){return this.sort((a,b)=>b-a);});

main();
return OUTPUT;
})();


var ns = function (a,b) {
    return a - b;
};
readline();
var a = readline().split(" ");
a.sort(ns);
var c = a.length;

for (var i = 0; i < a.length; i++){
    for (var j = i-1; j >= 0; j--){
        if (a[i]%a[j] == 0){
            c--
            break;
        }
    }
};
write(c);


const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
rl.question("", function(word) {
    let ans = word.split('')
    let j = ans.length - 1;
    let ans2 = ans.join('');
    let found = false
    for(let i = 0; !found  && i < ans.length; i++){
        for(let j = 0; j < ans.length; j++){
            let ans1 = ans2.slice(0, i) + ans[j] + ans2.slice(i, ans.length )
            if(checkPolindrom(ans1)){
                found = true;
                console.log(ans1);
                break;
            }
        }
    }

    for(let i = 0; !found  && i < ans.length; i++){
        if(ans[i] !== ans[j]){
            let ans1 = ans2 + ans[j];
            if(checkPolindrom(ans1)){
                found = true
                console.log(ans1)
                break;
            }
            ans1 = ans[j] + ans2;
            if(checkPolindrom(ans1)){
                found = true
                console.log(ans1)
                break;
            }
            ans1 = ans[i] + ans2;
            if(checkPolindrom(ans1)){
                found = true
                console.log(ans1)
                break;
            }
            ans1 = ans2 + ans[i];
            if(checkPolindrom(ans1)){
                found = true
                console.log(ans1)
                break;
            }
        }
    }
    if(!found)
        console.log('NA')
    process.exit(0)
})

rl.on("close", function() {
    console.log("\nBYE BYE !!!");
    process.exit(0);
});

function checkPolindrom(ans1){
    var splitString = ans1.split("");
    var reverseArray = splitString.reverse();
    let check = reverseArray.join("");
    return check === ans1;
}


T=readline().split(' ')
var n=Number(T[0]),pos=Number(T[1]),l=Number(T[2]),r=Number(T[3]);

if (l==1 && r==n) {
 print(0)
} else {
 var A=0;
 if (l>1) {
  A += Math.abs(l-pos) + 1
  pos = l
 }
 if (r<n) {
  A += Math.abs(pos-r) + 1
 }
 print(A)
}


var input = readline().split(' ').map(x => parseInt(x));
var allTabs = input[0];
var pos = input[1];
var l = input[2];
var r = input[3];
var start = 1;
var end = allTabs;
var result = 0;
var goLeft = false;
var goRight = false;

function calc() {
    if (pos < l) {
        result += l - pos;
        if (goRight) {
            result += Math.abs(l - r);
        }
    } else if (pos > r) {
        result += pos - r;
        if (goLeft) {
            result += Math.abs(l - r);
        }
    } else {
        if (goLeft && goRight) {
            result += Math.min(...[Math.abs(pos - l), Math.abs(pos - r)]) + Math.abs(l - r);
        } else if (goLeft) {
            result += Math.abs(pos - l);
        } else {
            result += Math.abs(pos - r);
        }

    }
}

if (l != start) {
    goLeft = true;
    result += 1;
}
if (r != end) {
    goRight = true;
    result += 1;
}

if (goLeft || goRight) {
    calc();
}

print(result);


var line = readline().split(' ');

var a = line[0];
var b = line[1];
var f = line[2];
var k = line[3];

var count = k;
var position = 1;
var amount = b;
var refill = 0;

if (amount < f || amount < a - f) {
  print(0);
} else {
  while (count > 0) {
    if (position === 1) {
      position = 2;
      count--;
      if (amount < 2 * a - f) {
        refill += 1;
        amount = b - (a - f);
      } else {
        amount -= a;
      }
      continue;
    }
    if (position === 2) {
      position = 1;
      count--;
      if (amount < a + f) {
        refill += 1;
        amount = b - f;
      } else {
        amount -= a;
      }
    }
  }
  print(refill);
}


const readline = require('readline');

// Create readline Interface
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let grid = [];
// Read Inputs

rl.on('line', lineInput => {
    grid.push(lineInput);
})
rl.on('close', () => {
    let r = grid[0].split(" ")[0];
    let c = grid[0].split(" ")[1];

    // rows
    let clearRows = 0, rows = [];
    for (let i = 1; i <= r; i++) {
        const row = grid[i];
        rows.push(row)
        if (!row.split('').includes('S'))
            clearRows++;
    }

    // cols
    let clearCols = 0;
    for (let i = 0; i < c; i++) {
        let f = 0;
        for (let j = 0; j < r; j++) {
            const box = rows[j].split('')[i];
            if (box === 'S') { f = 1; break; }
        }
        if (!f)
            clearCols++;
    }
    let overlaps = clearCols * clearRows;
    let ans = ((clearCols * r) + (clearRows * c)) - overlaps

    console.log(ans)

});


const readline = require('readline');

let secondLine = false;

// Create readline Interface
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let inputs = [];

rl.on('line', lineInput => {
    inputs.push(lineInput);
})

// Read Inputs
rl.on('close', () => {
    const line1 = inputs[0].split(' ');
    const r = parseInt(line1[0]);
    const c = parseInt(line1[1]);

    const rows = [];
    let clearRows = 0;
    let clearCols = 0;

    // rows
    for (let i = 1; i < r + 1; i++) {
        const row = inputs[i];
        rows.push(row)
        if (!row.split('').includes('S'))
            clearRows++;
    }

    // // cols
    for (let i = 0; i < c; i++) {
        let f = 0;
        for (let j = 0; j < r; j++) {
            const box = rows[j].split('')[i];
            if (box === 'S') { f = 1; break; }
        }
        if (!f)
            clearCols++;
    }
    let overlaps = clearCols * clearRows;
    let maximumCakes = ((clearCols * r) + (clearRows * c)) - overlaps

    console.log(maximumCakes)

});


// 330A     Тортминатор

//var n = parseInt(readline());
var input_line = readline().split(' ').map(Number);
var r =  input_line[0];
var c =  input_line[1];
//var m =  input_line[1];

var arrEnableS = [];
var countNullStr = 0;
var countS = 0;

for (var i = 0; i < r; i++) {
    var str = readline();
    var flagS = 'false';

    for (var j = 0; j < c; j++) {
        if (str[j] === 's') {
            arrEnableS[j] = 's';
            flagS = 'true';
        };
    };

    if (!flagS) countNullStr ++;

    arrEnableS.forEach(function(item, i, arrEnableS) {
        if (item === 's') countS ++;
    })
}

var out = countNullStr * c + countS * (r - countNullStr);

print(out);


'use strict';

function solve(n, a) {
  let cur = n;
  let cnt = 0;
  while (cur) {
    cnt++;
    cur = a[cur - 1];
  }
  return cnt === 3 ? 'YES' : 'NO';
}

async function main(read) {
  try {
    let t = Number(await read());
    let res = new Array(t);
    for (let i = 0; i < t; i++) {
      const n = Number(await read());
      const a = (await read()).split(' ').map(Number);
      res[i] = solve(n, a);
    }
    return res.join('\n');
  } catch (error) {
    console.log(error);
  }
}

let inputs,
    str = '';
function read() {
  return inputs.next().value.trim();
}
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', input => str += input);
process.stdin.on('end', async () => {
  inputs = str.split('\n').values();
  const output = await main(read);
  process.stdout.write(output);
});


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function main() {
    let t = Number(readline())
    while (t--) {
        let key = Number(readline())
        let doors = readline().split(' ').map(v => Number(v))
        let openedDoors = 0

        while (key != 0) {
            key = doors[key - 1]
            openedDoors += 1
        }

        if (openedDoors == 3) console.log('YES')
        else console.log('NO')
    }

}


var limit = parseInt(readline());
for (var i = 0; i < limit; i++)
{
    var keyInHand = parseInt(readline());
    var keysArray = readline().split(" ");
    var flag = false;
    var secondKey = parseInt(keysArray[keyInHand-1]);
    if (secondKey !== 0)
    {
        var thirdKey = parseInt(keysArray[secondKey-1]);
        if (thirdKey !== 0) flag = true;
    }
    if (flag) print("YES"); else print("NO");
}


'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function solve(read) {
  const [rn, rb, rns, re, rbs] = convertInput(read);
  const n = rn(),
        k = rn();
  const MOD = 10 ** 9 + 7;
  const f = new Array(n);
  f[0] = f[1] = 1;
  for (let i = 2; i <= n; i++) {
    f[i] = mul(f[i - 1], i);
  }
  const g = new Array(n);
  g[n] = power(f[n], MOD - 2);
  g[0] = 1;
  for (let i = n; i >= 2; i--) {
    g[i - 1] = mul(g[i], i);
  }
  let res = 0,
      max = Math.min(n, k);
  for (let i = 0; i <= max; i++) {
    res = (res + mul(f[n], g[i], g[n - i])) % MOD;
  }
  return res;
}
const MOD = 10 ** 9 + 7;
function power(a, b) {
  let res = 1;
  while (b) {
    if (b & 1) res = mul(res, a);
    a = mul(a, a);
    b = b >> 1;
  }
  return res;
}
function mul(...args) {
  if (args.length === 0) throw new Error('参数不能为空');
  if (args.length === 1) return args[0];
  const [a, b] = args;
  if (args.length > 2) return mul(mul(a, b), ...args.slice(2));
  return (Math.floor(a / 65536) * b % MOD * 65536 + (a & 65535) * b) % MOD;
}
function convertInput(read) {
  const rn = () => Number(read());
  const rb = () => BigInt(read());
  const rns = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rn();
    return res;
  };
  const re = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rn() - 1;
    return res;
  };
  const rbs = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rb();
    return res;
  };
  return [rn, rb, rns, re, rbs];
}
function main(r) {
  try {
    let t = 1;
    let res = new Array(t);
    let limit = 100;
    for (let i = 0; i < t; i++) {
      var _solve;
      const s = (_solve = solve(r)) !== null && _solve !== void 0 ? _solve : '';
      if (t < limit) {
        process.stdout.write(s.toString());
        process.stdout.write('\n');
      }
    }
    if (t >= limit) ; else {
      return '';
    }
  } catch (error) {
    console.log(error);
  }
}

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split(/\s+/);
void function () {
  const read = ((i = 0) => () => inputs[i++])();
  const output = main(read);
  process.stdout.write(output);
}();


var s = readline().trim(), x = 0;
for (var i = 0, j = s.length - 1; i < j; i++, j--)
    if (s[i] != s[j]) x += 1;
print(((x | s.length & 1) === 1) ? "YES" : "NO");


var N = readline();
var R = 0;
for (var i = 0; i < N.length >> 1; ++i) {
    R += N[i] == N[N.length - 1 - i] ? 0 : 1;
}
print(R == 1 ? "YES\n" : "NO\n");


var s = readline().trim(), cnt = 0;
for (var i = 0, j = s.length - 1; i < j; i++, j--) {
    if (s[i] != s[j]) {
        cnt += 1;
        if (cnt > 1) {
            break
        }
    }
}
print((cnt == 1) ? "YES" : "NO");


function dis(p1, p2) {
	return (p1.x-p2.x) * (p1.x-p2.x) + (p1.y-p2.y) * (p1.y-p2.y);
}

function needCover(d1, r1, d2 ,r2) {
	if (d1 > r1 && d2 > r2) {
		return true;
	} else {
		return false;
	}
}

var first = readline().split(" ").map(Number);
var n = first[0];
var p1 = {x : first[1], y : first[2]};
var p2 = {x : first[3], y : first[4]};
var a = [];
for (var i = 0; i < n; i++) {
	var body = readline().split(" ").map(Number);
	a[i] = {x : body[0], y : body[1]};
}

var r1 = 0, r2 = 0;
for (var i = 0; i < n; i++){
	var d1 = dis(p1, a[i]);
	var d2 = dis(p2, a[i]);
	if (needCover(d1, r1, d2 ,r2)) {
		if (d1 < d2 && r1 < d1) {
			r1 = d1;
		}
		if (d2 < d1 && r2 < d2) {
			r2 = d2;
		}
	}
}

print(r1 + r2);


var n = parseInt(readline());
var x = [];
var y = [];
var cx = 0;
var cy = 0;
for(var i=0;i<n;i++) {
    var t = readline().split(' ');
    var xx = parseInt(t[0]);
    var yy = parseInt(t[1]);
    var flag = false;
    for(var j=0;j<cx;j++) {
        if(x[j] == xx) {
            flag = true;
            break;
        }
    }
    if(flag == false) {
        x[cx++] = xx;
    }
    flag = false;
    for(var j=0;j<cy;j++) {
        if(y[j] == yy) {
            flag = true;
            break;
        }
    }
    if(flag == false) {
        y[cy++] = yy;
    }
}
if(cx != 2 && cy != 2) print("-1");
else {
    print(Math.abs(x[0]-x[1]) * Math.abs(y[0]-y[1]));
}


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

const daysInMonth = (month) => new Date(2017, month, 0).getDate();

rl.on('line', (data) => {
  const [m, d] = data.split(' ').map(Number);
  const days = daysInMonth(m);
  const ans = Math.ceil(days / 7);

  console.log(ans);
});


var s = readline();

var l = s.length, m = -1, n = 0, i = 0, ss = "", out = "";

for(i = 0; i< l; i++)
{
  if( s.charCodeAt(i) > m )
  {
    m = s.charCodeAt(i);
    n = 0
  }
  else if( s.charCodeAt(i) == m )
  {
    n++;
  }
}

ss.fromCharCode(m);

for(i = 0; i< n; i++)
{
  out = out + ss;
}

print(out);


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;
let n, d;

rl.on('line', (data) => {
  if (c === 0) {
    c++;
    [n, d] = data.split(' ').map(Number);
    return;
  }

  const arr = data.split('').map(Number);
  let ans = 0;
  let best = 0;
  let inc = 1;

  for (let i = 1; i < arr.length; i++) {
    if (arr[i] === 1) {
      best = Math.max(best, i);
    }

    if (inc === d || i + 1 === arr.length) {
      if (best === 0) {
        ans = -1;
        break;
      }
      else {
        ans++;
        i = best;
        best = 0;
        inc = 0;
      }
    }

    inc++;
  }

  console.log(ans);

  c++;
});


;(function () { // 344B

	print(function(a, b, c) {

		if ( (a + b > c) || (a + c > b) || (b + c > a) ) return 'Impossible';

		return [
			(0 + a + b - c) / 2,
			(0 - a + b + c) / 2,
			(0 + a - b + c) / 2
		].join(' ');

	}.apply(null, readline().split(' ').map(Number)));

}).call(this);


;(function () { // 344B

	print(function(a, b, c) {

		if ( (a + b < c) || (a + c < b) || (b + c < a) ) return 'Impossible';

		return [
			(0 + a + b - c) / 2,
			(0 - a + b + c) / 2,
			(0 + a - b + c) / 2
		].join(' ');

	}.apply(null, readline().split(' ').map(Number)));

}).call(this);


;(function () {

	var s = readline().split(' ').map(Number);
	var n = s[0], x = s[1], y = s[2];

	var r = Math.ceil(n * (y / 100));

	print( ( r - x ) );

}).call(this);


function main() {
    var n = parseInt(readline());

    if (n & 1) {
        print('1');
    } else {
        print('2');
    }
}

main();


var bord = [1, 2, 3, 4, 5, 6];
var size = bord.length;
var num1 = [2, 4, 6];
var tru = num1.sort(function (a, b) {return a - b; });
var four = tru[1] - tru[0],
    fourT = tru[2] - tru[1];
if (four === 1 && fourT === 1) {
    var out = 4;
} else if (four === 1 || fourT === 1) {
    var out = 1;
} else if (four === 2 && fourT === 2) {
    var out = 0;
} else {
    var out = 2;
}
var out;


print(function(a, b, c){
	for(var x=1; x<=a; x++)
		if(a%x===0 && b%(a/x)===0 && x*(b/(a/x))===c)
			return 4*(x+a/x+b/(a/x));
}.apply(0, readline().split(' ').map(Number)));


let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  const [ab, bc, ac] = readLine()
    .split(" ")
    .map((n) => parseInt(n));

  const b = Math.sqrt((ab * bc) / ac);
  const a = ab / b;
  const c = bc / b;

  console.log(4 * (a + b + c));
}


var xy = window.prompt();
xy = xy.split(" ");
var x = parseInt(xy[0]);
var y = parseInt(xy[1]);
if((y == 0 && x == 0) || (y == 0 && x == 1))
{
    window.alert("0");
}
else if((Math.abs(x) < Math.abs(y) && y > 0) || (-x == y && y > 0))
{
    window.alert(Math.abs(y*4) - 2);
}
else if((Math.abs(x) > Math.abs(y) && x < 0) || (x == y && x < 0))
{
    window.alert(Math.abs(x*4) - 1);
}
else if((Math.abs(x) < Math.abs(y) && y < 0) || (-x == y && y < 0) || x == -y + 1)
{
    window.alert(Math.abs(y*4));
}
else if((Math.abs(x) > Math.abs(y) && x > 0) || (x == y && x > 0))
{
    window.alert(Math.abs((x-1)*4) + 1);
}


function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function main() {
	var grid = [];
	for (var r = 0; r < 3; r += 1) {
		grid.push(trim(readline()));
	}
	for (var r = 0; r < 3; r += 1) {
		for (var c = 0; c < 3; c += 1) {
			if (grid[r][c] == 'X') {
				if (grid[2-r][2-c] == '.') {
					print("NO");
					return;
				}
			}
		}
	}
	print("YES");
}

main();


var str="";
str = readline();

var cnt = 0;
for(var i = 0;i<str.length;i++) {
	if(str[i]=='Q') {
		for(var j = i+1;j<str.length;j++) {
			if(str[j]=='A') {
				for(var k = j+1;k<str.length;k++) {
					if(str[k]=='Q')  cnt++;
				}

			}
		}
	}
}
print (cnt);


function rda(){ return readline().split(" ").map(Number); }
function rdn(){ return +readline(); }

var inp = rda();
var n = inp[0], bx = inp[1];
var x = rda();
inp = rda();
var m = inp[0], by = inp[1];
var y = rda();

var x10 = 0, y10 = 0;

var pows = [];
for(var i = 0, s = 1; i < n; i++, s *= bx){
    pows.push(s);
}
pows.reverse();
for(var i = 0; i < n; i++){
    x10 += pows[i]*x[i];
}

pows = [];
for(var i = 0, s = 1; i < m; i++, s *= by){
    pows.push(s);
}
pows.reverse();
for(var i = 0; i < m; i++){
    y10 += pows[i]*y[i];
}

if(x10 == y10){
    write("=");
}else if(x10 > y10){
    write(">");
}else{
    write("<");
}


(function() {
    'use strict';
    let n = readline();
    let r = readline().split('').map(String);
    let y = [];
    for(let i = 2; i <= n; i++) {
        if (n % i === 0) {
            y += i + ' ';
        }
    }
    if (y.length !== 0)
        y = y.split(' ').map(Number);
    y.splice(y.length - 1, 1);
    for (let i = 0; i < y.length; i++) {
        let m = r.splice(0, y[i]);
        m = m.reverse();
        r.splice.apply(r, [0, 0].concat(m));

   }

    print(r.join(''));
}());