let _inputLines;
let _lineNumber = 0;
let inputReader = _inputReader ();

function _main() {

	_inputLines = _inputData.trim().split('\n').map((string) => {
		return string.trim();
	});;
	let n = inputReader.readNumber();
	let a =1,b=1,c=0;
	let flag = true;
	while(n--){
		let num = inputReader.readNumber();
		if(num===1){
			if(a===1){
				if(b===1){
					b=0;
					c=1;
				}
				else{
					c=0;
					b=1;
				}
			}
			else{
				flag=false;
			}
		}
		else if(num===2){
			if(b===1){
				if(a===1){
					a=0;
					c=1;
				}
				else{
					c=0;
					a=1;
				}
			}
			else{
				flag=false;
			}
		}
		if(num===3){
			if(c===1){
				if(b===1){
					b=0;
					a=1;
				}
				else{
					a=0;
					b=1;
				}
			}
			else{
				flag=false;
			}
		}
	}

	if(flag)
		console.log("YES");
	else
		console.log("NO");
	//console.log(obj);

}

var _inputData = '';
function cacheInput(data) {
	_inputData += data;
}

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', cacheInput).on('end', _main);

function _inputReader () {
	function readNumber(){
		return Number(_inputLines[_lineNumber++]);
	}

	return {
		readNumber,
	}
}


'use strict'

const {EOL} = require('os')

let ipt = ''
process.stdin.on('data', s => ipt += s)
process.stdin.on('end', () => {
  let n = +ipt.split(EOL)[0]

  const N = ['Sheldon', 'Leonard', 'Penny', 'Rajesh', 'Howard']

  let i = -1
  while (n - 5 * Math.pow(2, ++i) > 0) n -= 5 * Math.pow(2, i)
  let j = 1
  while (n - j * Math.pow(2, i) > 0) j++
  console.log(N[j - 1])
})


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
	};
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
	var N = nextInt();
	var s = next();
	var output = 0;
	for(var i = 0; i < N; i++){
		if(s[i] == "U" && s[i + 1] == "R" || s[i] == "R" && s[i + 1] == "U"){
			output++;
			i++;
		}else{
			output++;
		}
	}
	myout(output);
}


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

let inp = 0
process.stdin.on("data",input=>{
    inp = input
})
process.stdin.on("end",input=>{

    main();

})

function main(){
if(inp%2===0&&inp!=2){console.log("YES")} 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()
    .split(" ")
    .map((x) => +x);

  carrotCakes(x[0],x[1],x[2],x[3]);
}

function carrotCakes(n, t, k, d) {

  let t1 = (n * t) / k;

  let tt1 = 0;
  let cakesBox2 = 0;
  let ovenTimer11 = 0;

  while (cakesBox2 < n) {
    if (ovenTimer11 === t - 1) {
      ovenTimer11 = 0;
      cakesBox2 += k;
    } else {
      ovenTimer11++;
    }

    tt1++;
  }

  // let t2 = t1 / 2 + d - Math.abs(t - d);

  //   let k1 = Math.floor(d * k) / t;

  // let k1 = (d * k) / t;

  //   let t2 = ((n - k1) * t) / (2 * k) + d;

  //   let t2 = d < t ? ((n - k1) * t) / (2 * k) + d : t1 / 2 + d;
  // console.log(t1, t1);

  let t2 = 0;
  let cakesBox = 0;
  let ovenTimer1 = 0;
  let ovenTimer2 = 0;

  while (cakesBox < n) {
    if (ovenTimer1 === t - 1) {
      ovenTimer1 = 0;
      cakesBox += k;
    } else {
      ovenTimer1++;
    }

    if (t2 >= d) {
      if (ovenTimer2 === t - 1) {
        ovenTimer2 = 0;
        cakesBox += k;
      } else {
        ovenTimer2++;
      }
    }
    t2++;
  }

  console.log(t2 < tt1 ? "YES" : "NO");
}


const readline = require('readline');
const z=2 ;
const x=1;
const c=100
const rl = readline.createInterface({
  input: process.stdin
});
rl.on('line', (input) => {
  if (input.trim()>=x && input.trim()<=c){
  if (input.trim() % z != 0 || input.trim()==2 )
  {
    console.log("NO");
  }
  else
  {
    console.log("YES");
  }
}
  rl.close();
});


process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
    let input = process.stdin.read();
    input = input.trim();

    if (input !== null) {
        let AAAAAAAAAAAAAs = 0;
        let NotAAAAAAAAAAs = [];

        for (let i = 0; i < input.length; i++) {
            if (input[i] == 'a') AAAAAAAAAAAAAs++;
            else NotAAAAAAAAAAs.push(i);
        }

        input = input.split('');

        while (AAAAAAAAAAAAAs <= NotAAAAAAAAAAs.length) {
            input.splice(input.indexOf(NotAAAAAAAAAAs[0]), 1);
            NotAAAAAAAAAAs.shift();
        }

        process.stdout.write(`${input.length}\n`);
        process.exit(0);
    }
});


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

var idx = 0;
var out = 0;
var totalScores = 0;
var passScore = 0;
rl.on("line", (theLine) => {
    if (idx === 0) {
        var lines = theLine.split(" ");
        totalScores = parseInt(lines[0]);
        passScore = parseInt(lines[1])-1;
    }
    else {
        var scores =  theLine.split(" ");
        var currentCount = 0;
        if (totalScores > 0) {
            scores.forEach(element => {
                if ((parseInt(element) > 0) && (parseInt(element) >= parseInt(scores[passScore])))
                    out++;
            });
        }
    }
    idx++;
    if (idx > 1)
    {
        rl.close();
        console.log(out.toString());
    }

})


process.stdin.on('data',c=>{[n,m,a]=c.toString().split(' ');
x=Math.ceil;
console.log(x(n/a)*x(m/a))})


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

let standardInputString = '';
let currentLine = 0;

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

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

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

function main() {
    let message = Array.from(readLine());
    const word = Array.from('hello');
    let counter = 0;
    if(!message.join("").includes('h')) {
        console.log('NO');
        return;
    }
    for(let i = message.indexOf('h'); i < message.length; i++) {
        if(message[i] === word[counter]) {
            if((word.length - 1) === counter) {
                console.log("YES");
                return;
            }
            counter++;
        }
    }
    console.log("NO")
}


let table = [0];
let j = "";
for(let i=0;i<55;i++)
{
    j+= "1"
    table[i+1] = BigInt(j);
}

let dp = {};

let i = ''
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL)
    console.log(calc(BigInt(lines[0])));
});

function abs(x)
{
    return (x>=0)?x:0n-x;
}

function max(v1,v2)
{
    return (v1>v2)?v1:v2;
}

function min(v1,v2)
{
    return (v1>v2)?v2:v1;
}

function calc(x)
{
    if (x==0) return 0;

    let str = x.toString();
    if (dp[str]) return dp[str];
    let n = str.length;

    let v1 = abs(table[n+1]-x);
    let v2 = abs(table[n]-x);

    let ret;

    let diff = abs(v1-v2);
    let mx = max(v1,v2);
    let ratio = Number(diff * 100n / mx) / 100;
    if (ratio<=0.1)
    {
        ret = min(n+1+calc(v1),n+calc(v2));
    }
    else
    {
        if (v1<v2)
        {
            ret = n+1+calc(v1);
        }
        else
        {
            ret = n+calc(v2);
        }
    }

    dp[str] = ret;
    return ret;
}


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

rl.on("line", (line) => {
  let params = line.split(" ");
  let smaller = parseInt(params[0]);
  if (parseInt(params[1]) <= parseInt(params[0])) smaller = params[1];
  if (smaller % 2 == 0) console.log("Malvika");
  else console.log("Akshat");
});

rl.on("close", () => {});


let readline  = require('readline');
let intInput = readline.createInterface({
	input: process.stdin,
	output: process.stdout
});
let input;
intInput.on('line', (line) => {
	input = line.split(" ");
});
intInput.on('close', () => {
	let a = Number(input[0]);
	let b = Number(input[1]);
	let c = 0
	while (a <= b) {
		a = a * 3;
		b = b * 2;
		c++
	}
	console.log(c)
})


const readline = require("readline")

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

let colouredStones;
let instructions;
let currentStoneCounter = 0

rl.on("line", (input) => {
    if (!colouredStones) {
        colouredStones = input.split(" ").toString();
      //  console.log(colouredStones, typeof (colouredStones))
    } else {
        instructions = input.split(" ").toString()
        for (let index = 0; index < instructions.length; index++) {
            if (instructions[index] == colouredStones[currentStoneCounter]) {
                currentStoneCounter++
            }
        }
        console.log(currentStoneCounter+1)
        rl.close();
    }

})


function howMany(dim, x) {
    // let pairs = [];

    let amt = 0;

    const max = Math.min(x, dim);//Make sure both factors are in the table
    for (let i = 1; i <= max; i++) {//Find all factor pairs of X
        const pair = x / i;
        if (Math.floor(pair) == pair && pair <= dim) {//If a pair has been found
            amt++;
            // pairs.push([i, pair]);
        }
    }
    // console.log(pairs);
    // amt *= 2; //Only half the table is evaluated, to be more efficient
    return amt;
}

process.stdin.addListener("data", data => {
    const nums = data.toString().split(" ").map(n => parseInt(n));
    console.log(howMany(nums[0], nums[1]));
});


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

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  const [a1, a2, a3] = input[0].split(' ').map(x => parseInt(x));
  const [b1, b2, b3] = input[1].split(' ').map(x => parseInt(x));
  const [n] = input[2].split(' ').map(x => parseInt(x));

  let sum = Math.ceil((a1+a2+a3)/5) + Math.ceil((b1+b2+b3)/10);
  if (sum <= n) console.log('YES');
  else console.log('NO');
});


const readline = require('readline');

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

rl.on('line', (input) => {
    //console.log(input);
    //ar = input.split(' ');

    let a = Math.floor(input / 2);
    let b = input - a;
    let ar = a.toString().split("")

    let total = 0;
    let ten = 0;

    for (let i = ar.length - 1; i>0; i--) {
        let fix = 9 - parseInt(ar[i], 10);
        ar[i] = 9;
        b -= fix * (Math.pow(10, ten));
        ten++;
    }
    let br = b.toString().split("")

    ar.forEach(elem => {
        total += parseInt(elem, 10);
    });
    br.forEach(elem => {
        total += parseInt(elem, 10);
    });

    console.log(total);

    rl.close();
});


function processData(input) {
	//     time Complexity O(n)
	//Enter your code here
	var data = input.split("\n");
	var [n, k] = data[0].split(" ").map(a => parseInt(a));
	var arr = data[1].split(" ").map(a => parseInt(a));
	var target = arr[k - 1];
	arr.sort((a, b) => b - a);
	var count = 0;
	for (var i = 0; i < arr.length; i++) {
		if (arr[k - 1] != 0) {
			if (arr[i] >= target) {
				count++;
			}
		} else {
			if (arr[i] > target) {
				count++;
			}
		}
	}
	console.log(count);
}

process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function(input) {
	_input += input;
});

process.stdin.on("end", function() {
	processData(_input);
});


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

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  let str = input[0];

  for (let i = 0; i < str.length; i += 1) {
    if (str[i] === 'H' || str[i] === 'Q' || str[i] === '9') {
      console.log('YES'); process.exit();
    }
  }

  console.log('NO');
});


'use strict';

function createReadLine() {
  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++];
  }

  return readline;
}

const readline = createReadLine();

function readInts(){
  return readline().split(' ').map((value => Number.parseInt(value)));
}

function readFloats(){
  return readline().split(' ').map((value => Number.parseFloat(value)));
}

function readStr() {
  return readline();
}

function readInt(){
  return Number.parseInt(readline());
}

function readFloat(){
  return Number.parseFloat(readline());
}

function main() {
  const str = readStr();
  const result = solve(str);
  console.log(result);
}

function solve(str){
  str = [...str]
  const subStr = [...'QAQ']
  const resultArr =  new Array(subStr.length).fill(0).map(() => new Array(str.length).fill(0));
  str.forEach((s, index) => {
    if(s === subStr[0]){
      resultArr[0][index] = 1
    } else {
      resultArr[0][index] = 0
    }
  })

  for (let i = 1; i < subStr.length; i ++){
    for (let j = 0; j < str.length; j ++){
      if(str[j] === subStr[i]){
        let sum = 0;
        for (let k = 0; k < j; k ++) {
          sum += resultArr[i-1][k]
        }
        resultArr[i][j] = sum;
      }
    }
  }
  let sum = 0;
  resultArr[subStr.length - 1].forEach(v => sum += v)
  return sum;
}

module.exports.solve = solve;


const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    const output = []
    for (let i = 0; i < t; i++) {
        const n = +lines[l++]
        output[i] = solve(n)
    }
    console.log(output.join('\n'))
// })()
})

function solve(n) {
    let a = 0
    let b = 0
    let c = 0
    for (let i = 1; i < 32000; i++) {
        if (i * i <= n) a++
        if (Math.pow(i, 3) <= n) b++
        if (Math.pow(i, 6) <= n) c++
    }
    return a + b - c
}


let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/
    let vasayInput = lines[0].split(" ").map( element => {
        return parseInt(element)
    })
    let redSocksCount = vasayInput[0]
    let blueSocksCount = vasayInput[1]
    distributeSocks(redSocksCount, blueSocksCount)
})

function distributeSocks(redSocks, blueSocks) {
    let hipsterDaySocksCount = Math.min(redSocks, blueSocks)

    let remainingBlueSocks = blueSocks - hipsterDaySocksCount
    let remainingRedSocks = redSocks - hipsterDaySocksCount

    let normalDaysSocks = 0

    normalDaysSocks += parseInt(remainingBlueSocks / 2)
    normalDaysSocks += parseInt(remainingRedSocks / 2)

    console.log(hipsterDaySocksCount + " " + normalDaysSocks)
}


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n');
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr('time : ' + end + 'ms');
  myerr('memory : ' + Math.round(process.memoryUsage().heapTotal / 1024) + 'KB');
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var one = nextIntArray();
  var max = Math.max(one[0], one[1]);
  var ok = 6 - max + 1;
  myout((ok / gcd(ok, 6)) + "/" + (6 / gcd(ok, 6)));
}
function gcd(m, n) {return n != 0 ? gcd(n, m % n) : m;}


const stdin = process.stdin;
stdin.setEncoding( 'utf8' );
stdin.on( 'data', function( rawInput ){
    const inputLines = rawInput.split('\n');
    const n = parseInt(inputLines[0]);
    const result = solve(n);
    console.log(result? "YES": "NO");
});

function solve(totalWeight) {
    if (totalWeight < 4) {
        return false;
    }
    return totalWeight % 2 === 0;
}


const readline = require('readline');

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

rl.question('', (input) => {
  let weight = Number(input);

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

  rl.close();
});


'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 noOfTestCases = Number(readline());
    let testCaseArray = [];
    for (let i = 0; i < noOfTestCases; i++) {
        testCaseArray.push(readline());
    }
    let maxValue = Math.max(...testCaseArray);
    let array = calArray(maxValue);
    for (let i = 0; i < noOfTestCases; i++) {
        numberOfValues(array, testCaseArray[i])
    }
}

function calArray(maxValue) {
    let set = new Set();
    let i = 1;
    while (maxValue >= i * i) {
        const square = i * i;
        const cube = i * i * i;
        set.add(square);
        if (cube <= maxValue) set.add(cube);
        i++;
    }
    return Array.from(set).sort((a, b) => a - b);
}

function numberOfValues(array, num) {
    let i = 0;
    while (array[i] <= num) {
        i++;
    }
    console.log(i);
}


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

r.on('line',(line)=>{
     console.log(compute(line));
  });

function* range(start, end) {
    while (start <= end) yield start++;
}

function getTimeIndex(str) {
    let [h,m] = str.split(":").map(n => +n);
    return h * 60 + m;
}
function isPalindrome(str)
{
    return str === (str.split("").reverse().join(""))
}
let hours = [...range(0, 23)].map(n => n < 10 ? "0" + n : "" + n);
let minutes = [...range(0, 59)].map(n => n < 10 ? "0" + n : "" + n);

let time = hours.reduce((ac, h) => {
    minutes.forEach(m => ac.push(h + ":" + m));
    return ac;
}, []);
let times = [...time, ...time];

function compute(str) {
    let startIndex = getTimeIndex(str)+1;
    while( startIndex < times.length)
    {
        if(isPalindrome(times[startIndex]))
            return times[startIndex];

        startIndex++;
    }

}


const readline = require('readline')

async function algo() {
  const n = await int()
  let count = 1
  for(let i = 2; i <= n / 2; i ++) {
    if ((n - i) % i == 0) count ++
  }
  console.log(count)
}

// read the input
const _lines = []
let _lineIndex = 0
let _ended = false
const _rl = readline.createInterface(process.stdin)
_rl.on('line', line => _lines.push(line))
_rl.on('end', () => (ended = true))
const wait = ms => new Promise(resolve => setTimeout(resolve, ms))
const line = async () => {
  while (!_ended && _lines.length <= _lineIndex) await wait(10)
  const result = _lines[_lineIndex].trim()
  _lines[_lineIndex] = null
  _lineIndex++
  return result
}
const words = async () => (await line()).split(' ')
const chars = async () => (await line()).split('')
const int = async () => parseInt(await line())
const ints = async () => (await words()).map(x => parseInt(x))
const big = async () => BigInt(await line())
const bigs = async () => (await words()).map(x => BigInt(x))

algo()


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

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () =>
{
    // const nums = input[1].split(' ').map(x => parseInt(x));

    let myString = input[0];

 let bySet= new Set ()

for (let i = 0; i < myString.length; i++) {
     bySet.add (myString[i])

}

    if (bySet.size%2==0) {
        console.log('CHAT WITH HER!');

    }else {
        console.log('IGNORE HIM!')
    }

});


'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 money = readline().split(' ');
        money = parseInt(money);

    minNumBills(money);
};

function minNumBills(amt){
  let bills = [1, 5, 10, 20, 100];

  let idx = bills.length - 1;
  let billCount = 0;

  while(amt > 0 && idx >= 0){
    let cur = bills[idx];
    if(amt < cur){
      idx--;
      continue;
    }
    amt = amt - cur;
    billCount++;

    if(amt < cur)  idx --;
  }
  console.log(billCount);
  return billCount;
}


const readline = require('readline');

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

var count = 0;
var k;
var places;

rl.on('line', line => {
    if (count === 0) {
        k = line.split(' ')[1];
        count++;
        return;
    }

    if (count === 1) {
        places = line.split(' ').map(item => parseInt(item));
        rl.close();
    }
});

rl.on('close', () => {
    var targetScore = places[k-1];
    var result = 0;

    while(result !== places.length) {
        var manScore = places[result];

        if (manScore === 0 || manScore < targetScore) break;

        result ++;
    }

    console.log(result);

    rl.close();
});


// Sample code to perform I/O:

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;                               // Reading input from STDIN
});

process.stdin.on("end", function () {
    main(stdin_input);
});

function main(input) {
    let output = nameLookUp(input);
    process.stdout.write(output);       // Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

// Write your code here
function nameLookUp(arr) {
    let nLines = arr.trim().split('\n');
    let firstStr = nLines[0].trim().toLowerCase();
    let secondStr = nLines[1].trim().toLowerCase();
    let comparison = 0;
    if(firstStr > secondStr){
        comparison = 1;
    }
    if(firstStr < secondStr){
        comparison = -1;
    }
    return comparison.toString();

}


const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;
let w, h;
let u1, u2, d1, d2;

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

  if (c === 1) {
    c++;
    [u1, d1] = d.split(' ').map(Number);
    return;
  }

  [u2, d2] = d.split(' ').map(Number);

  c++;
});

rl.on('close', () => {
  let ans = w;

  while (h > 0) {
    ans += h;

    if (h === d1) {
      ans -= u1;
    }

    if (h === d2) {
      ans -= u2;
    }

    if (ans < 0) {
      ans = 0;
    }

    h--;
  }

  console.log(Math.max(0, ans));
});


let input = ''
process.stdin.on('data', c => input += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = input.split(EOL)
    const testCount = parseInt(lines[0]);
    lines.shift();

    for(let i=0;i<testCount;i++) {
        const line = i*2;
        let numbers = [...lines[line].split(" "), ...lines[line + 1].split(" ")];
        numbers = numbers.filter(num => num == '1');
        if(!numbers.length) console.log(0)
        else if(numbers.length == 4) console.log(2)
        else console.log(1)
    }
})


// https://codeforces.com/problemset/problem/977/B
// Big O:
// Time complexity: O(n)
// Space complexity: O(n)

const readline = require("readline");

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

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] + 1 : 1;
        if (occurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = occurrences;
        }

        gramOccurrences[twogram] = occurrences;
    }

    return mostCommonGram;
}


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

const input = [];
readLine.on('line', line => input.push(line));
const elephant = () => {
    let steps = Math.floor(input[0]/5);
    if (input[0]% 5 !== 0) {
        steps++;
    }
    console.log(steps);
};

readLine.on('close', elephant);


let buf='';

process.stdin.on('readable',function(){
    let chunk=process.stdin.read();
    if(chunk) buf+=chunk.toString();
})

process.stdin.on('end',function(){
    let line=buf.split(' ');
    let n=parseInt(line[0]),m=parseInt(line[1]);
    if(m!==1)
    {
        // console.log(n,m-1);
        let a=BigInt(n);
        let b=BigInt(m-1);
        let ans=a*b;
        // ans=ans.toString();
        // let res='';
        // for(let i=0;i<ans.length;i++) res+=ans[i];
        // console.log(res);
        console.log(ans.toString());
    }
    else console.log(n-1);
})


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 = readLine();
    t = parseInt(t);
    while(t--) {
        let line = readLine();
        line = line.split(" ");
        let n = parseInt(line[0]);
        let ans = null;
		if (n == 1) {
			ans = 1;
		} else if (n == 11) {
			ans = 3;
		} else if (n == 111) {
			ans = 6;
		} else if (n == 1111) {
			ans = 10;
		} else {
			let cnt = n.toString().split("").length;
			let k = n % 10;
			ans = ( k - 1) * 10;
			if (cnt == 1) {
				ans = ans + 1;
			} else if (cnt == 2) {
				ans = ans + 3;
			} else if (cnt == 3) {
				ans = ans + 6;
			} else if (cnt == 4) {
				ans = ans + 10;
			}
		}

        console.log(ans);
    }
}


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n');
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr('time : ' + end + 'ms');
  myerr('memory : ' + Math.round(process.memoryUsage().heapTotal / 1024) + 'KB');
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var one = nextIntArray();
  if(one[0] <= one[1] && one[0] <= one[2]){
  	myout("Yes");
  }else{
  	myout("No");
  }
}


let i = '';

process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL);
    var t = lines[0]
    for(j = 1; j <= t; j++){
        var s = 0
        var n = lines[j]
        for(k = 0; k < n; k++){
            s +=  s + 1
        }
        console.log(s   )
    }
});


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw "ArrayIndexOutOfBoundsException ‚There is no more input";}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt() + 1;
  while(true){
    var s = myconv(N.toString(), 0);
    var used = new Set();
    for(var i = 0; i < s.length; i++){
      used.add(s[i]);
    }
    if(used.size == 4){
      break;
    }
    N++;
  }
  myout(N);

}


const readline = require('readline');

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

let limak = 0;
let bob = 0;
let years = 0;
rl.on("line",(input)=>{
    limak = parseInt(input.split(" ")[0])
    bob = parseInt(input.split(" ")[1])
    while(limak<=bob){
        bob*=2
        limak*=3
        years++
    }
    console.log(years)
    rl.close();
})


const readline = require('readline');

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

rl.on('line', function (input) {
   // myArr = input.split(' ').map(item => {return parseInt(item);});
var N = parseInt(input);
var Primes = [];
for(var i = 2; i <= N; i++)
    if (IsPrime(i)) Primes.push(i);

var ans = 0;
for (var i = 1; i <= N; i++)
    if (IsAlmostPrime(i, Primes)) ans++;

console.log(ans);

    rl.close();
})

//******************************MY FUNCTIONS */

function IsPrime(n)
{
    if (n == 2 ) return true;
    if (n <= 1|| n%2==0)
        return false;
        //for (int i = 2; i <= n/2; i++)
        //    if (n % i == 0)
        //        return false;
      var limit = parseInt(Math.sqrt(n));
    for (var i = 3; i <= limit; i+=2)
        if (n % i == 0)
           return false;

    return true;
}

function IsAlmostPrime(n, pNums)
{
    var countDivisor = 0;
    for (var i = 0; i < pNums.length; i++)
    {
        if (n % pNums[i] == 0) countDivisor++;
        if (pNums[i] > n / 2) break;
    }
    return countDivisor == 2;
}


const stdin = process.stdin;
stdin.setEncoding("utf8");
stdin.on("data", function(rawInput) {
  const inputLines = rawInput.split(/\s+/);
  const n = parseInt(inputLines[0]);
  const result = solve(n);
  console.log(result);
});

function solve(n) {
  let a = Math.floor(n / 2);
  let b = n - a;

  while (getGCD(a, b) != 1) {
    a--;
    b++;
  }

  return `${a} ${b}`;
}

function getGCD(a, b) {
  while (b != 0) {
    const tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}


"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();
  const x2 = readline();

  stonesOnTheTable(x2);
}

function stonesOnTheTable(palette) {
  let colorsCount = 0;

  for (let i = 0; i < palette.length - 1; i++) {
    const curr = palette[i];
    const next = palette[i + 1];

    if (/[RGB]/.test(curr) && /[RGB]/.test(next) && curr === next)
      colorsCount++;
  }
  console.log(colorsCount);

  return colorsCount;
}


const state = { stdin: Buffer.alloc(0) };
const consume = (chunk) =>
  (state.stdin = Buffer.concat(
    [state.stdin, chunk],
    state.stdin.length + chunk.length
  ));
const commit = (answer) => process.stdout.write(answer);
//
const main = (args) => {
  let data = parseInt(state.stdin.toString("utf8"));
  let solution = "NO";
//   if (data < 1 || data > 100) return commit(solution);

  for (let i = 1; i < data; i++) {
    let part = (data - i) % 2 ===0;
    if (i % 2 === 0 && part) {
      solution = "YES";
      commit(solution);
      return;
    }
  }
  commit(solution);
};

process.stdin.on("data", consume).on("end", main);


const readline = require("readline")

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

let arrOfShoes
let similarCounter = 0

rl.on("line", (input) => {
    if (!arrOfShoes) {
        arrOfShoes = input.split(" ").map(Number)
    }
    if (arrOfShoes) {
        arrOfShoes.forEach((shoe,index) => {
            if(arrOfShoes.includes(shoe,index+1)){
                similarCounter++
            }
        });
        console.log(similarCounter)
        rl.close();

    }
})


'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 main() {
    var matrix = [];
    for (var i = 0; i < 5; i++) {
        let arr = readLine()
            .split(' ')
            .map(value => parseInt(value));
        matrix.push(arr);
    }

    let coordinate = [];

    for (var i = 0; i < 5; i++) {
        if (matrix[i].indexOf(1) != -1) {
            coordinate.push(i);
            coordinate.push(matrix[i].indexOf(1));
        }
    }

    let ans = Math.abs(2 - coordinate[0]) + Math.abs(2 - coordinate[1]);
    console.log(ans);
}


process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', (inputStd) => {
    inputString += inputStd;
});
process.stdin.on('end', function () {
    inputString = inputString
        .trim()
        .split('\n')
        .map((str) => {
            return str.trim();
        });
    main();
});
function readLine() {
    return inputString[currentLine++];
}

function main() {
    let word = readLine();
    let wordArray = word.split('');
    let smallLetters = [];
    let CapitalLetters = [];
    for (let i = 0; i < wordArray.length; i++) {
        if (
            wordArray[i] === wordArray[i].toUpperCase() &&
            wordArray[i] !== wordArray[i].toLowerCase()
        ) {
            CapitalLetters.push(wordArray[i]);
        } else {
            smallLetters.push(wordArray[i]);
        }
    }
    if (CapitalLetters.length > smallLetters.length) {
        console.log(word.toUpperCase());
    } else {
        console.log(word.toLowerCase());
    }
}


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

const getNumber = (k) => {
  let str = '';
  let i = 1;

  while (str.length < k) {
    str += i;
    i += 1;
  }

  return str[k - 1];
};

readline.on('line', (line) => {
  const k = Number(line);

  console.log(getNumber(k));
});


/**
 * Created by ishanarora on 30/11/18.
 */

const stdin = process.openStdin();
let content = ``;
stdin.addListener('data', d => {
  content += d.toString();
});

stdin.addListener('end', () => {
    content = content.split("\n");
    console.log(countrySide(parseInt(content[0]), (content[1].split(" "))));
});

function countrySide(count, samples) {

    let lastElement = parseInt(samples.pop());

    if (lastElement == 0) {
        return 'UP'
    }

    if (lastElement == 15) {
        return 'DOWN'
    }

    let secondLast = samples.pop();
    if (secondLast === undefined) {
        return -1;
    }else{
        secondLast = parseInt(secondLast);
    }

    let initialDecision = 'DOWN'

    if (lastElement > secondLast) {
        initialDecision = 'UP';
    }

    return initialDecision;
}


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

let currentLine = 0;
let inputString = "";

process.stdin.on("data", (raw_data) => {
  inputString += raw_data;
});

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

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

/******** Main function*************/

function main() {
  var [n, k] = readLine().split(" ").map(Number);

  while (k > 0) {
    var num = n.toString().split("").map(Number);
    if (num[num.length - 1] === 0) {
      n = n / 10;
    } else {
      n = n - 1;
    }
    k--;
  }
  console.log(n);
}

/**
 * if the last digit of the number is non-zero,
 * she decreases the number by one;
 *
 * if the last digit of the number is zero,
 * she divides the number by 10 (i.e. removes the last digit).
 */


var read = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function (input) { inLine.push(input); });
read.on('close', function () {
    obj = init(inLine);
    myerr("-----start-----");
    var start = new Date();
    Main();
    var end = new Date() - start;
    myerr("----- end -----");
    myerr("Time: " + (end) + "ms");
    myerr("Memory: " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function nextInt() { return myconv(next(), 1); }
function nextStrArray() { return myconv(next(), 2); }
function nextIntArray() { return myconv(next(), 4); }
function nextCharArray() { return myconv(next(), 6); }
function next() { return obj.next(); }
function hasNext() { return obj.hasNext(); }
function init(input) {
    var returnObj = {
        list: input, index: 0, max: input.length,
        hasNext: function () { return (this.index < this.max); },
        next: function () { if (!this.hasNext()) { throw "ArrayIndexOutOfBoundsException"; } else { var returnInput = this.list[this.index]; this.index++; return returnInput; } }
    };
    return returnObj;
}
function myout(s) { console.log(s); }
function myerr(s) { console.error("debug:" + require("util").inspect(s, false, null)); }
function myconv(i, no) { try { switch (no) { case 1: return parseInt(i); case 2: return i.split(" "); case 4: return i.split(" ").map(Number); case 6: return i.split(""); case 7: return i.split("").map(Number); case 8: return i.join(" "); case 9: return i.join("\n"); case 0: return i.join(""); default: return i; } } catch (e) { return i; } }

function Main() {
    var in1 = nextIntArray();
    var n = in1[0];
    var k = in1[1] - 1;

    var in2 = nextIntArray();

    var winning_score = in2[k];

    var n_winners = 0;
    for (var i = 0; i < in2.length; i++) {
        if (winning_score <= in2[i] && in2[i] > 0) {
            n_winners++;
        }
    }

    return myout(n_winners);
} // Use Terminal to debug, not Debug Console!


"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();
  const y =  readline();
  petyaAndStrings(x,y);
}

function petyaAndStrings(a, b) {
  if (a.toLowerCase() > b.toLowerCase()) {
    console.log(1);
    return 1;
  } else if (a.toLowerCase() < b.toLowerCase()) {
    console.log(-1);
    return -1;
  } else {
    console.log(0);
    return 0;
  }
}


/**
 *
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this
language appear in it at least once. Pangrams are often used to demonstrate fonts in printing or test the output devices.

You are given a string consisting of lowercase and uppercase Latin letters.
 Check whether this string is a pangram. We say that the string contains a letter of the Latin alphabet
 if this letter occurs in the string in uppercase or lowercase.

 */
'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();
    });

    pangram(inputString[0], inputString[1]);
});

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

function pangram(stringLength, word) {

    let line = readline()
    let alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
    let stringToMap = {};
    let occurance = {};
    word = word.toLowerCase();

    for (let index = 0; index < stringLength; index++) {
        stringToMap[word[index]] = 1;
    }

    for (let index = 0; index < alphabet.length; index++) {
        if (stringToMap[alphabet[index]])
            occurance[alphabet[index]] = 1
    }

    if (Object.keys(occurance).length == alphabet.length)
        console.log('YES');

    else
       console.log('NO');
}


// Input
'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++];
}

//main
function main() {
    var [n,m,a] = readline().split(" ").map(e=>parseInt(e));
    var nbn = n%a === 0 ? n/a : Math.floor(n/a)+1, nbm = m%a === 0 ? m/a : Math.floor(m/a)+1;
    console.log(nbn*nbm);

}


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

rl.on('line', (d) => {
  const [n, m, k] = d.split(' ').map(Number);
  let inc = 1;

  let x, y;
  isDone :{
    for (let i = 0; i < n; i++) {
      for (let j = 0; j < m; j++) {
        for (let z = 0; z < 2; z++) {
          if (inc === k) {
            x = i + 1;
            y = j + 1;
            break isDone;
          }

          inc++;
        }
      }
    }
  }

  console.log(x, y, k % 2 ? 'L' : 'R');

  c++;
});


'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() {
    let w = readline();
    w = parseInt(w);

    if (w%2 === 0 && w > 2) {
        console.log('YES');
    } else {
        console.log('NO');
    }
}


// Sample code to perform I/O:

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;                               // Reading input from STDIN
});

process.stdin.on("end", function () {
    main(stdin_input);
});

function main(input) {
    let output = nameLookUp(input);
    process.stdout.write(output);       // Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

// Write your code here
function nameLookUp(arr) {
    let nMatrix = arr.split('+');
    for (let i = 1; i < nMatrix.length; i++) {
        let min = +nMatrix[i];
        let j = i - 1;
        while (j >= 0 && +nMatrix[j] > min) {
            nMatrix[j + 1] = +nMatrix[j];
            j--;
        }
        nMatrix[j + 1] = min;
    }
    return nMatrix.join('+').toString();

}


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw "ArrayIndexOutOfBoundsException ‚There is no more input";}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  myout(Math.ceil(N / 5));
}


const readline = require('readline');
const rl = readline.createInterface({input: process.stdin});
var input = [];
rl.on('line', function (line) {input.push(line);});
rl.on('close', function() {
    let year = input[0];
    year = Number(year) + 1;
    year = year.toString().split('');
    let result = '';

    while([...new Set(year)].length !== year.length) {
        year = Number(year.join('')) + 1;
        year = year.toString().split('');
    }

    console.log(year.join(''));
});


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n↑入力 ↓出力');
  Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var x = nextInt();
  if(x % 4 == 1){
    myout("0 A");
  }else if(x % 4 == 2){
    myout("1 B");
  }else if(x % 4 == 3){
    myout("2 A");
  }else if(x % 4 == 0){
    myout("1 A");
  }
}


process.stdin.on('data', (data) => {
  let result = 0;
  const array = data.toString().trim().split('')
  Promise.all(array.reverse().map(datum => {
    result += 10 - datum - 1;
    return Promise.resolve();
  })).then(() => {
    console.log(result + +array[array.length - 1] + Boolean(array.length - 1))
  });
})


const input = [];

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

RL.on('line', (line) => {
    input.push(line);
});

RL.on('close', () => {
  const firstStr = input.pop().toLowerCase();
  const secondStr = input.pop().toLowerCase();

  for (let i = 0; i < firstStr.length; i += 1) {
    if (firstStr.charCodeAt(i) > secondStr.charCodeAt(i)) {
      console.log(-1);
      return;
    } else if (firstStr.charCodeAt(i) < secondStr.charCodeAt(i)) {
      console.log(1);
      return;
    }
  }

  console.log(0);
});


function IO(rs, ws, readSize = 1024) {
  let buffer = Buffer.from([]);
  let nextLineIndex;
  let line;
  let chunk;

  return {
    rl() {
      while(true) {
        newLineIndex = buffer.indexOf('\n');

        if (newLineIndex === -1 && rs.readableLength === 0) {
          newLineIndex = buffer.length;
        }

        if (newLineIndex !== -1) {
          line = buffer.slice(0, newLineIndex);

          buffer = buffer.slice(newLineIndex + 1);

          return line.toString('utf-8');
        }

        if (rs.readableLength === 0) {
          return null
        }

        chunk = rs.read(Math.min(readSize, rs.readableLength));

        if (!chunk) { return null; }

        buffer = Buffer.concat([ buffer, chunk ]);
      }
    },

    wr(str) {
      return ws.write(str);
    },

    wl(str) {
      return ws.write(str + '\n');
    }
  };
}

process.stdin.once('readable', () => sol(IO(process.stdin, process.stdout)));

function sol({ rl, wr, wl }) {
  let [n, k] = rl().split(' ').map(Number);

  while(true) {
    if (k === 0){
      return wl(n);
    }

    if (n % 10 === 0) n /= 10;
    else n -= 1;

    k -= 1;
  }
}


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

rl.on('line', (d) => {
  if (c === 0) {
    c++;
    max = +d;
    return;
  }

  if (c === 1) {
    arr1 = d.split(' ').map(Number);
    c++;
    return;
  }

  arr2 = d.split(' ').map(Number);

  c++;
});

rl.on('close', () => {
  let common = 0;

  for (let i = 0; i < arr1.length; i++) {
    common += arr1[i] && arr2[i];
  }

  let sum1 = arr1.reduce((a, x) => a + x, 0) - common;
  let sum2 = arr2.reduce((a, x) => a + x, 0) - common;
  let ans = sum1 > sum2 ? 1 : -1;

  for (let i = 1; i <= max; i++) {
    if (sum1 * i > sum2) {
      ans = i;
      break;
    }
  }

  console.log(ans);
});


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

// 자음
var j = [ 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z', 'n' ];

// 모음
var m = [ 'a', 'o', 'u', 'i', 'e' ];

// 반드시 자음 + 모음
// 모음 + (자 or 모), n + (자 or 모)

rl.on('line', function(line) {
	if(!line) {
		process.exit()
  }

  var w = line;
  var v = true;

  for(var i = 0; i < w.length; i++) {
    if(w[i] === 'n') {
      continue;
    }

    if(j.indexOf(w[i]) > -1)  {
      // w[i]가 자음
      if(m.indexOf(w[i + 1]) === -1)  {
        v = false;
        break;
      }

      continue;
    }
  }

  console.log(v ? 'YES' : 'NO');
})


var n = readline().trim() + "";

function sumOfDigitsInNumber(k){
    var s = 0;
    var a = k.split("").map((h) => {s += +h;})
    return s;
}

function doingSmthWithNumberIDontKnowWhy(n){
    var k = n.split("").reverse();
    var min = false;
    for(var i = 0; i < k.length; i++){
        if(k[i] != "9" && !min && i != k.length - 1){
            k[i] = 9;
            min = true;
        }else if(min){
            if(k[i] == "0"){
                k[i] = 9;
            }else{
                k[i] = (+k[i] - 1) + "";
                break;
            }
        }
    }

    if(k[k.length - 1] == "0"){
        k = k.reverse().join("").substr(1, k.length);
    }else{
        k = k.reverse().join("");
    }

    return (k == n ? "-" : k);
}

var a = [];
var r = 0;
var t = n;
var max = 0;
while(t != "-"){
    a[r] = [t, sumOfDigitsInNumber(t)];
    t = doingSmthWithNumberIDontKnowWhy(t);
    r++;
}

a.sort((a, b) => {
    if(a[1] < b[1]){
        return 1
    }else{
        return -1;
    }
    return 0;
})

var b = [];
var j = 0;
for(var i = 0; i < r; i++){
    if(a[0][1] == a[i][1]){
        b[j] = a[i];
        j++;
        if(max < a[i][0].length){
            max = a[i][0].length;
        }
    }
}

var c = [];
r = 0;
for(var i = 0; i < j; i++){
    if(b[i][0].length == max){
        c[r] = a[i];
        r++;
    }
}

for(var i = 0; i < max; i++){
    var max_digit = 0;

    for(var j = 0; j < r; j++){
        if(+c[j][0][i] > max_digit) max_digit = +c[j][0][i];
    }

    max_digit = max_digit + "";
    for(var j = 0; j < r; j++){
        if(c[j][0][i] != max_digit){
            c.splice(j, 1);
            r--;
        }
    }

}

print(c[0][0]);


let data = '';
process.stdin.on('data', c => data += c);
const solution = () => {
	let line = data.split('\n');
	let n = parseInt(line[0], 10);
	let a = line[1].replace(/RU|UR/g,"D").trim();
	console.log(a.length);

};

process.stdin.on('end', solution);


function countMarkers(w1, h1, w2, h2){
    let totalBoxes2 = w2 + (2 * h2) + 2; // ((w2+2) * (h2+1)) - (w2 * h2);
    let totalBoxes1 = w1 + (2 * h1) + 2; // ((w1+2) * (h1+1)) - (w1 * h1);
    let rightAllOff = w1 - w2;
    return totalBoxes1 + totalBoxes2 + rightAllOff;

}

function processData(input) {
    //Enter your code here
    // const readline = require('readline');
    var numbers = input.split(" ").map(function(x) { return +x; });

    console.log(countMarkers(numbers[0], numbers[1], numbers[2], numbers[3]))

}

process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
    _input += input;
});

process.stdin.on("end", function () {
   processData(_input);
});


var readline = require("readline");
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
var expect = 'n';
rl.on("line",function(line){
    if(expect == 'n'){
        expect = 'stones';
    }else {
        var s = line;
        var j = 0;
        for (var i = 0; i< s.length; i++){
            if(s[i] == s[i+1]){
                j++;
            }
        }
    console.log(j);
    process.exit(0);
    }
});


const mainFunction = (lines) => {
    let arr = lines[1].split(" ").map(Number).sort((a, b) => a - b);
    arr = [...new Set(arr)]
    //console.log(arr)
    for(let i = 1; i < arr.length - 1; i++) {
        if( Math.abs(arr[i-1]-arr[i]) == Math.abs(arr[i+1]-arr[i]) && Math.abs(arr[i-1]-arr[i]) == 1
            && [...new Set([arr[i-1], arr[i], arr[i+1]])].length == 3){
            //console.log([arr[i-1], arr[i], arr[i+1]])
            console.log("YES"); return 0;
        }
    }
    console.log("NO");
}

const { EOL } = require('os')
const fs = require("fs");
if (__filename.substr(9, 4) != "azer") {
    let yourInput = ''
    process.stdin.on('data', i => yourInput += i)
    process.stdin.on('end', () => mainFunction(yourInput.split(EOL)))
} else {
    mainFunction(fs.readFileSync('input.txt', 'utf8').split(EOL))
}


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

const input = [];

readLine.on('line', line => input.push(line));

function sort(arr) {
  for (let i = 1; i < arr.length; i += 1) {
    for (let j = i; j > 0; j -= 1) {
      if (arr[j] < arr[j-1]) [arr[j], arr[j-1]] = [arr[j-1], arr[j]];
    }
  }
}

readLine.on('close', () => {
  const nums = input[0].split('+').map(x => parseInt(x));
  sort(nums);

  console.log(nums.join('+'));
});


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 [n, k, l, c, d, p, nl, np] = readLine()
    .split(" ")
    .map((n) => parseInt(n));

  console.log(Math.floor(Math.min((k * l) / nl, c * d, p / np) / n));
}


'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 printResult(x) {
    process.stdout.write(x);
}

function main() {
    const k = parseInt(readLine(), 10);
    const arr = readLine().split(' ').map(Number);

    const result = businessTrip(k, arr);
    printResult(result.toString());
}

const compare = (a, b) => b - a;

const businessTrip = (k, a) => {
    a.sort(compare);

    if (k === 0) return k;
    let sum = 0;
    for (let i = 0; i < 12; i++) {
        if (sum + a[i] < k) {
            sum += a[i];
        } else {
            return i + 1;
        }
    }

    return -1;
};


const readline = require("readline");

let inputs = [];

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

rl.on("line", line => inputs.push(line));

rl.on("close", () => solution(inputs));

function solution([_, data]) {
	const columns = data.split(" ").map(Number);
	const ans = columns.sort((a, b) => a - b);
	return console.log(...ans);
};


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

rl.on('line', (str) => {
  console.log(str.split('WUB').filter(x => x.length > 0).join(' '));
});


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

rl.on('line', (data) => {
  if (c === 0) {
    k = +data;
    c++;
    return;
  }

  if (c === 1) {
    l = +data;
    c++;
    return;
  }

  if (c === 2) {
    m = +data;
    c++;
    return;
  }

  if (c === 3) {
    n = +data;
    c++;
    return;
  }

  if (c === 4) {
    d = +data;
    c++;
  }

  let ans = 0;
  for (let i = 1; i <= d; i++) {
    if (i % k === 0 || i % l === 0 || i % m === 0 || i % n === 0) {
      ans++;
    }
  }

  console.log(ans);

  c++;
});


//Helpful Maths

const {EOL} = require('os');

let inp = '';

process.stdin.on('data', c => inp += c);

process.stdin.on('end', () => {
    process.stdout.write(inp.split(EOL)[0].split('+').sort((a, b) => (+a) - (+b)).join('+'));

    return;
});


function main() {
    // write code here:
    var arr=stdin[0].split(' ').map(a => Number(a)),m=arr[0];
    for(var i=0;i<arr[1];i++){
        if(m%10===0){
            m/=10;
        }else{
            m-=1;
        }
    }
    console.log(m);
}

const readline = require('readline');
const rl = readline.createInterface({input: process.stdin});
var stdin = [];
rl.on('line', function (line) {stdin.push(line);});
rl.on('close', main);


function ProblemSolver() {
    this.HAS_TEST_CASES = false ;
    this.INPUT_FILE_NAME = "sample.in" ;
    this.OUTPUT_FILE_NAME = "sample.out" ;
    this.DO_OUTPUT_TO_FILE = false ;
    this.CLEAR_ARRAY_PER_CASE = false ;

    this.solveCase = function() {
        var res , i , j , fl , cn , a , b , c , d ;
        res = 0 ;
        a = this.min1 ;
        b = this.min2 ;
        c = this.min3 ;
        d = this.n - ( a + b + c ) ;
        for( i = 1 ; i <= d ; i++ ) {
            if( a + 1 <= this.max1 ) {
                a++ ;
            }
            else if( b + 1 <= this.max2 ) {
                b++ ;
            }
            else if( c + 1 <= this.max3 ) {
                c++ ;
            }
        }
        print( a + ' ' + b + ' ' + c ) ;
    } ;

    this.init = function() {
        this.lim1 = 100010 ;
        this.lim2 = 110 ;
        this.cc = 1 ;
        this.ind = 1 ;
        this.n = 0 ;
        this.cn = 0 ;
        this.declareAndFillArrays() ;
    } ;

    this.getInput = function( irObj ) {
        var hasMoreInput , i ;
        hasMoreInput = true ;
        try {
        	this.n = irObj.nextInt() ;
        	this.min1 = irObj.nextInt() ;
        	this.max1 = irObj.nextInt() ;
        	this.min2 = irObj.nextInt() ;
        	this.max2 = irObj.nextInt() ;
        	this.min3 = irObj.nextInt() ;
        	this.max3 = irObj.nextInt() ;
        }
        catch( ex ) {
            hasMoreInput = false ;
        }
        return hasMoreInput ;
    } ;

    this.clearArraysPerCase = function() {
        var i ;
        this.arr = new Array() ;
        this.adjList = new Array() ;
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.arr.push( 0 ) ;
            this.adjList.push( new Array() ) ;
        }
    } ;

    this.clearPerCase = function() {
        this.cn = 0 ;
        this.cc++ ;
        if( this.CLEAR_ARRAY_PER_CASE == true ) {
            this.clearArraysPerCase() ;
        }
    } ;

    this.declareAndFillArrays = function() {
        var i , j ;
        this.srr = new Array() ;
        this.vis = new Array() ;
        this.arr = new Array() ;
        this.brr = new Array() ;
        this.memo = new Array() ;
        this.done = new Array() ;
        this.adjList = new Array() ;
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.srr.push( '' ) ;
            this.vis.push( 0 ) ;
            this.arr.push( 0 ) ;
            this.brr.push( 0 ) ;
            this.adjList.push( new Array() ) ;
        }
        for( i = 0 ; i < this.lim2 ; i++ ) {
            this.memo.push( new Array() ) ;
            this.done.push( new Array() ) ;
            for( j = 0 ; j < this.lim2 ; j++ ) {
                this.memo[ i ].push( -1 ) ;
                this.done[ i ].push( 0 ) ;
            }
        }
    } ;

    this.init() ;
}

function InputReader() {
    var self = this ;
    this.allLines = new Array() ;
    this.currrentLineNumber = 0 ;
    this.currrentCharacterIndex = 0 ;
    this.callBackFunction = null ;
    this.parentContext = null ;

    this.readAllLines = function() {
        var singleLine ;
        while( true ) {
            try {
                singleLine = readline() ;
                if( singleLine == null ) {
                    break ;
                }
            }
            catch( ex ) {
                break ;
            }
            this.allLines.push( singleLine ) ;
        }
    } ;

    this.readAllLinesFromRhino = function() {
        var brObj , line ;
        importPackage( java.io ) ;
        importPackage( java.lang ) ;
        brObj = new BufferedReader( new InputStreamReader( System[ 'in' ] ) ) ;
        this.allLines = [] ;
        while( true ) {
            line = brObj.readLine() ;
            if( line == null ) {
                break;
            }
            this.allLines.push( line ) ;
        }
    } ;

    this.readSingleLinesFromNodeJsJudgeServer = function( chunk ) {
        self.chunkData += chunk ;
    } ;

    this.readEndFromNodeJsJudgeServer = function() {
        self.parseRawData( self.chunkData ) ;
        self.parentContext.runCases() ;
    } ;

    this.readAllLinesFromNodeJsJudgeServer = function( parentContext ) {
        this.parentContext = parentContext ;
        process.stdin.resume() ;
        process.stdin.setEncoding( 'utf8' ) ;
        this.chunkData = '' ;
        process.stdin.on( 'data' , this.readSingleLinesFromNodeJsJudgeServer ) ;
        process.stdin.on( 'end' , this.readEndFromNodeJsJudgeServer ) ;
    } ;

    this.parseRawData = function( data ) {
        var len , i , currentString ;
        len = data.length ;
        currentString = '' ;
        this.allLines = [] ;
        for( i = 0 ; i < len ; i++ ) {
            if( data[ i ] == '\r' ) {
            }
            else if( data[ i ] == '\n' ) {
                this.allLines.push( currentString ) ;
                currentString = '' ;
            }
            else {
                currentString += data[ i ] ;
            }
        }
        if( currentString != '' ) {
            this.allLines.push( currentString ) ;
        }
    } ;

    this.readAllLinesFromFile = function( inputFileName ) {
        var currentDirectory , fsObj , inputFilePath , rawData ;
        fsObj = require( 'fs' ) ;
        currentDirectory = __dirname ;
        if( currentDirectory.indexOf( 'D:' ) != -1 ) {
            //on windows
            inputFilePath = currentDirectory + '\\' + inputFileName ;
        }
        else {
            //on linux
            inputFilePath = currentDirectory + '/' + inputFileName ;
        }
        rawData = fsObj.readFileSync( inputFilePath , "utf8" ) ;
        this.parseRawData( rawData ) ;
    } ;

    this.next = function( flag ) {
        var len , i , startIdx , res , endIdx ;
        if( flag == 0 ) {
            if( this.currrentCharacterIndex != 0 ) {
                this.currrentLineNumber++ ;
                this.currrentCharacterIndex = 0 ;
            }
            res = '' ;
            len = this.allLines[ this.currrentLineNumber ].length ;
            if( typeof( len ) == 'function' ) {
                len = this.allLines[ this.currrentLineNumber ].length() ;
            }
            for( i = this.currrentCharacterIndex ; i < len ; i++ ) {
                res += '' + this.allLines[ this.currrentLineNumber ].charAt( i ) ;
            }
            this.currrentLineNumber++ ;
            this.currrentCharacterIndex = 0 ;
            return res ;
        }
        while( true ) {
            if( this.currrentLineNumber >= this.allLines.length ) {
                throw new Error( 'No more tokens available!' ) ;
            }
            startIdx = -1 ;
            len = this.allLines[ this.currrentLineNumber ].length ;
            if( typeof( len ) == 'function' ) {
                len = this.allLines[ this.currrentLineNumber ].length() ;
            }
            for( i = this.currrentCharacterIndex ; i < len ; i++ ) {
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) != ' '.charCodeAt( 0 ) ) {
                    startIdx = i ;
                    break ;
                }
            }
            if( startIdx == -1 ) {
                this.currrentLineNumber++ ;
                this.currrentCharacterIndex = 0 ;
                continue ;
            }
            res = '' ;
            endIdx = len - 1 ;
            for( i = startIdx ; i < len ; i++ ) {
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) == ' '.charCodeAt( 0 ) ) {
                    endIdx = i ;
                    break ;
                }
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) >= 48 && this.allLines[ this.currrentLineNumber ].charCodeAt( i ) <= 57 ) {
                    res += '' + ( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) - 48 ) ;
                }
                else {
                    res += '' + this.allLines[ this.currrentLineNumber ].charAt( i ) ;
                }
            }
            this.currrentCharacterIndex = endIdx ;
            if( endIdx == len - 1 ) {
                this.currrentLineNumber++ ;
                this.currrentCharacterIndex = 0 ;
            }
            return res ;
        }
    } ;

    this.nextInt = function() {
        return parseInt( this.next( 1 ) ) ;
    } ;

    this.nextDouble = function() {
        return parseFloat( this.next( 1 ) ) ;
    } ;

    this.nextString = function() {
        return this.next( 1 ) ;
    } ;

    this.nextLine = function() {
        return this.next( 0 ) ;
    } ;
}

function FileOutputHandler() {
    this.resultantStringArray = new Array() ;

    this.addNewLine = function( newString ) {
        this.resultantStringArray.push( newString ) ;
    } ;

    this.clearPercase = function() {
        this.resultantStringArray = new Array() ;
    } ;

    this.flushOutOutputToFile = function( outputFileName ) {
        var i , sz , res , currentDirectory , fsObj , outputFilePath ;
        res = '' ;
        sz = this.resultantStringArray.length ;
        for( i = 0 ; i < sz ; i++ ) {
            if( i != 0 ) {
                res += '\n' ;
            }
            res += this.resultantStringArray[ i ] ;
        }
        fsObj = require( 'fs' ) ;
        currentDirectory = __dirname ;
        if( currentDirectory.indexOf( 'D:' ) != -1 ) {
            //on windows
            outputFilePath = currentDirectory + '\\' + outputFileName ;
        }
        else {
            //on linux
            outputFilePath = currentDirectory + '/' + outputFileName ;
        }
        fsObj.writeFileSync( outputFilePath , res ) ;
        this.clearPercase() ;
    } ;
}

function CodeExecutioner() {
    this.irObj = new InputReader() ;
    this.psObj = new ProblemSolver() ;
    this.fohObj = new FileOutputHandler() ;

    this.runCases = function() {
		var testCases , hasMoreTestCases , i ;
        if( this.psObj.HAS_TEST_CASES == true ) {
            testCases = this.irObj.nextInt() ;
            for( i = 0 ; i < testCases ; i++ ) {
                this.psObj.clearPerCase() ;
                this.psObj.getInput( this.irObj ) ;
                this.psObj.solveCase() ;
            }
        }
        else {
            while( true ) {
                this.psObj.clearPerCase() ;
                hasMoreTestCases = this.psObj.getInput( this.irObj ) ;
                if( hasMoreTestCases == false ) {
                    break;
                }
                this.psObj.solveCase() ;
            }
        }
        if( this.psObj.DO_OUTPUT_TO_FILE == true ) {
            this.fohObj.flushOutOutputToFile( this.psObj.OUTPUT_FILE_NAME ) ;
        }
    } ;

    this.detectEnvironmentType = function() {
        var environmentType = null ;
        try {
            if( importPackage != null ) {
                environmentType = 'rhino' ;
            }
        }
        catch( ex1 ) {
            try {
                //for nodejs local server check
                if( __dirname != null && ( __dirname.indexOf( 'D:') != -1 || __dirname.indexOf( '/media/') != -1 ) ) {
                    environmentType = 'local-node-js' ;
                }
                else {
                    environmentType = 'server-node-js' ;
                }
            }
            catch( ex2 ) {
                try {
                    if( readline == null || typeof( readline ) != 'function' ) {
                        environmentType = 'server-node-js' ;
                    }
                    else {
                        try {
                            if( Map != null ) {
                                environmentType = 'spider-monkey' ;
                            }
                            else {
                                environmentType = 'javascript-v8' ;
                            }
                        }
                        catch( ex3 ) {
                            environmentType = 'javascript-v8' ;
                        }
                    }
                }
                catch( ex3 ) {
                    environmentType = 'server-node-js' ;
                }
            }
        }
        return environmentType ;
    } ;

    this.configureStreamsAndReadInput = function() {
        var localContext , isNodeJsJudgeServer , environmentType ;
        isNodeJsJudgeServer = false ;
        environmentType = this.detectEnvironmentType() ;
        if( environmentType == 'local-node-js' ) {
            try {
                if( print == null || typeof( print ) != 'function' ) {
                    print = console.log ;
                }
            }
            catch( ex ) {
                print = console.log ;
            }
            if( this.psObj.DO_OUTPUT_TO_FILE == true ) {
                localContext = this.fohObj ;
                print = function() {
                    localContext.addNewLine.apply( localContext , arguments ) ;
                }
            }
            this.irObj.readAllLinesFromFile( this.psObj.INPUT_FILE_NAME ) ;
            this.runCases() ;
        }
        else if( environmentType == 'server-node-js' ) {
            try {
                if( print == null || typeof( print ) != 'function' ) {
                    print = console.log ;
                }
            }
            catch( ex ) {
                print = console.log ;
            }
            this.irObj.readAllLinesFromNodeJsJudgeServer( this ) ;
        }
        else if( environmentType == 'javascript-v8' ) {
            this.irObj.readAllLines() ;
            this.runCases() ;
        }
        else if( environmentType == 'rhino' ) {
            this.irObj.readAllLinesFromRhino() ;
            this.runCases() ;
        }
        else if( environmentType == 'spider-monkey' ) {
            this.irObj.readAllLines() ;
            this.runCases() ;
        }
    } ;

    this.configureStreamsAndReadInput() ;
}

new CodeExecutioner() ;


const readline = require('readline');

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

var str = [];
var conts = 0;

function main() {
	rl.question('', (answer) => {
		if (answer.length) {
			str.push(answer.toUpperCase());
			conts++;
			if(conts == 2){
				rl.close();
				solve();
			} else main();
		}
	});
}
function solve() {
	if(str[0] == str[1]) console.log(0);
	else if(str[0] < str[1]) console.log(-1);
	else console.log(1);
}
main();


'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 print(s) {
  process.stdout.write(`${s}`);
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  // input
  let [n, t, k, d] = readline().split(' ').map(x => parseInt(x));
  const t1 = Math.ceil(n / k) * t;
  let built = false;
  let st = 0;
  let dt = t;
  while (n > 0) {
    if (st > d && !built) {
      built = true;
      dt = Math.ceil(st - d);
      st += t - dt;
      n -= k;
    } else if (built) {
      st += t - dt;
      n -= k;
    }
    if (n > 0) {
      st += dt;
      n -= k;
    }
  }
 // output
  print(st < t1 ? 'YES' : '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();
});

const readLine=()=> inputString[currentLine++];
/* ================================================
           Main Solution Starts Here
===================================================*/

const main=()=>{
	let x=readLine().split('+').map(n=>+n)
	x=x.sort().toString()
	let str=''
	for(let i=0;i<x.length;i++){
		if(x[i]===',')
			str+='+'
		else str+=x[i]
	}
	console.log(str)
}


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++];
}

// utils
const MOD = 1e9 + 7;
const mod = (n) => ((n % MOD) + MOD) % MOD;
const add = (a, b) => mod(mod(a) + mod(b));
const sub = (a, b) => mod(mod(a) - mod(b));
function mul() {
  for (var a = arguments, r = a[0], i = a.length; --i; )
    r = ((((r >> 16) * a[i]) % MOD) * 65536 + (r & 65535) * a[i]) % MOD;
  return r;
}
function inv(b) {
  for (var a = MOD, u = 0, v = 1, t; b; v = t)
    (t = (a / b) | 0), (a -= t * b), (u -= t * v), (t = a), (a = b), (b = t), (t = u), (u = v);
  u %= MOD;
  return u < 0 ? u + MOD : u;
}
function pow(base, n) {
  if (n === 0) return 1;
  let p = pow(base, Math.floor(n / 2));
  let res = mul(mod(p), mod(p));
  if (n % 2 === 1) res = mul(mod(res), base);
  return res;
}
function highestOneBit(i) {
  i |= i >> 1;
  i |= i >> 2;
  i |= i >> 4;
  i |= i >> 8;
  i |= i >> 16;
  return i - (i >>> 1);
}
function permutation(arr, len, store = "", permutations = []) {
  if (store.length === len) {
    permutations.push(store);
    return;
  }
  for (let i = 0; i < arr.length; i++) {
    const newArr = [...arr];
    const newChar = newArr.splice(i, 1);
    permutation(newArr, len, store.concat(newChar), permutations);
  }
  return permutations;
}

function main() {
  let [count100, count200] = [0, 0];
  const len = +readLine();
  const arr = readLine()
    .split(" ")
    .map((n) => {
      n = parseInt(n);
      if (n === 100) count100++;
      else count200++;
      return n;
    });

  const sum = arr.reduce((total, num) => total + num, 0);

  if (Math.floor(sum / 2) % 2 !== 0 || count100 % 2 !== 0 || (count200 === len && count200 % 2 !== 0)) {
    console.log("NO");
  } else {
    console.log("YES");
  }
}


"use strict";

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

readline.on('line', line => {
    readline.close(), console.log(capsLocks(line));
});
const capsLocks = (word) => {
    const upperCase = /^[A-ZÑ]+$/g;

    if (word.length > 1) {
        const first = word.charAt(0);
        const last = word.slice(1);

        if (upperCase.test(word))
            return word.toLowerCase();
        else if (upperCase.test(last) && !upperCase.test(first))
            return first.toUpperCase() + last.toLowerCase();
        else
            return word;
    }
    else
        if (!upperCase.test(word))
            return word.toUpperCase();
        else
            return word.toLowerCase();
}


let fs = require("fs");

let txt = fs.readFileSync(0, "utf-8").split("\r\n").filter(data => {
    return data.length > 0;
});
for (let i = 0; i < txt.length; i++) {
    let info = txt[i].split(" ");
    doit(info[0] * 1, info[1] * 1, info[2] * 1);
}

function doit(m, n, a) {
    console.log(Math.ceil(m / a) * Math.ceil(n / a));

}


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

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
    const n = +input.shift();
    const s = new Set(input[0].toLowerCase());
    console.log(s.size === 26 ? 'YES' : 'NO');
});


// Sample code to perform I/O:

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;                               // Reading input from STDIN
});

process.stdin.on("end", function () {
    main(stdin_input);
});

function main(input) {
    let output = nameLookUp(input);
    process.stdout.write(output);       // Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

// Write your code here
function nameLookUp(str) {
    let inputs = str.trim().split('\n');
    let dragons = inputs.slice(0, inputs.length - 1);
    let totalDragons = +inputs[inputs.length - 1];
    let damagedDragons = [];

    for (let row of dragons) {
        for (let i = 1; i <= totalDragons; i++) {
            let multiple = row * i;
            if (multiple <= totalDragons) {
                damagedDragons.push(multiple);
            }
        }
    }
    damagedDragons = [...new Set(damagedDragons)].length;
    return damagedDragons.toString();
}


const readline = require('readline');

let inputs = [];

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

// Read Inputs
rl.on('line', inputLine => {
    const n = parseInt(inputLine);

    if (n >= 0) {
        return console.log(n)
    } else {
        let digits = Math.abs(n).toString().split('');
        const lastNum = digits[digits.length - 1];
        const numBeforeLast = digits[digits.length - 2];
        if (lastNum > numBeforeLast) {
            const temp = digits.slice(0);
            const idxOfLast = temp.length - 1;
            temp.splice(idxOfLast, 1)
            return console.log(`-${temp.join('')}`)
        } else {
            const temp = digits.slice(0);
            const idxBeforeLast = temp.length - 2;
            temp.splice(idxBeforeLast, 1)

            if (temp.join('') == 0)
                return console.log(temp.join(''))

            return console.log(`-${temp.join('')}`)
        }

        return console.log(`-${digits.join('')}`)

    }

});


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

let a, b, c;
rl.on('line', (line) => {
    [a, b, c] = line.split(' ').map(i => parseInt(i));
}).on('close', () => {
    process.stdout.write("" + Math.ceil(a / c) * Math.ceil(b / c));
});


let [n, s] = require('fs')
    .readFileSync(0, 'ascii')
    .split('\n')
    .filter(line => !/^\s*$/.test(line));

let min = 0;
let sum = 0;
for (const c of s) {
    if (c == '+') {
        sum++;
    } else if (c == '-') {
        sum--;
        if (sum < min)
            min = sum;
    }
}

console.log(sum - min);


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 n1 = readLine();
  const n2 = readLine();
  let n = "";
  for (let i = 0; i < n1.length; i++) {
    const bit = +n1[i] ^ +n2[i];
    n += `${bit}`;
  }
  console.log(n);
}


const readline = require('readline');

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

rl.on('line', input => {
    let sum = 0
    n = +input
    for (let i = 0; i < n; i++) {
        sum += (n - i) * i
    }
    console.log(sum + n)
    rl.close();
});


var readline = require("readline");

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

function ans(line) {
  return line
    .toLowerCase()
    .split("")
    .map(function(e) {
      if ("aeioyu".includes(e)) return "";
      else return "." + e;
    })
    .join("");
}

rl.on("line", function(line) {
  console.log(ans(line));
});


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

let standardInputString= '';
let currentLine = 0;

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

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

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

  main();
})

function main(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

    let consecutives = 0;

  let result = 0;
  line.unshift(0);
  line.push(1001);

    for(let i =1; i<=n; i++){
      if(line[i]-1 ===line[i-1]&& line[i+1] -1 === line[i]){
        consecutives++;
      }
      else{
        consecutives = 0;
      }
      result = Math.max(result, consecutives);
    }
    console.log(result);
  }


// Interface of codeforces.com
const readline = require('readline');
const matrix = [];

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

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

rl.on('close', () => console.log(solution(matrix)));

function makeMatrix(line) {
    const row = line.split(' ').map(char => Number(char));
    matrix.push(row);
}

function solution(matrix) {
// Get the matrix from the input and put it into a data structure
// Count the minimum number needed to make the matrix beautiful
    const index = getIndex(matrix);
    return (Math.abs(2 - index[0]) + Math.abs(2 - index[1]));

}

// Finds and returns the index of '1'
function getIndex(matrix) {
    let x = 0, y = 0;
    for (let i = 0; i < matrix.length; i++) {
        for (let j = 0; j < matrix.length; j++) {
            if (matrix[i][j] === 1) {
                return [i, j];
            }
        }
    }
}


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

process.stdin.on('data', (input) => {
  process.stdout.write(input.match(/h+.*e+.*l+.*l+.*o+.*/g) ? 'YES' : 'NO');
});


const readline = require('readline');

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

rl.on('line', line => {
  line
    .split(' ')
    .map(Number)
    .reduce((a, b) => {
      a > b ? console.log(`${b} ${Math.floor((a - b) / 2)}`) : console.log(`${a} ${Math.floor((b - a) / 2)}`);
    });
}).on('close', () => {
  process.exit(0);
});


let _inputLines;
let _lineNumber = 0;
let inputReader = _inputReader ();

function _main() {

	_inputLines = _inputData.trim().split('\n').map((string) => {
		return string.trim();
	});;
	let str = inputReader.readLine();
	let n = inputReader.readNumber();
	let arr = [];

	let bool = false;
	for (let i = 0; i < n; i++) {
		arr[i] = inputReader.readLine();
		if (arr[i] === str) {
			bool = true;
		}
	}

	if (n === 1) {
		let str1 = "" + arr[0] + arr[0];
		if (str[0] == str1[1] && str[1] == str1[2]) {
			bool = true;
		}
		//console.log(str1,str1[1],str[0]);
	} else if (!bool) {
		for (let i = 0; i < n; i++) {
			for (let j = 0; j < n; j++) {
				let res = arr[i] + arr[j];
				if (str[0] == res[1] && str[1] == res[2]) {
					bool = true;
					break;
				}
			}
			if (bool) break;
		}
	}
	if (bool) {
		console.log("YES");
	} else {
		console.log("NO");
	}

}

var _inputData = '';
function cacheInput(data) {
	_inputData += data;
}

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', cacheInput).on('end', _main);

function _inputReader () {
	function readNumber(){
		return Number(_inputLines[_lineNumber++]);
	}

	function readLine(){
		return _inputLines[_lineNumber++];
	}

	return {
		readNumber,
		readLine,
	}
}


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

const input = [];
readline.on('line', line => input.push(line));

readline.on('close', () => {
    let [number, count] = input[0].split(' ').map(v => parseInt(v));
    while (count--) {
        if (number % 10 === 0) {
            number /= 10;
            continue;
        }
        number--;
    }

    console.log(number);
});


let i = '';

process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL);
    var t = lines[0].split('');
    var sum = 0;
    for(var j=0;j<t.length;j++) {
      sum += (t[j] == 'a') ? 1 : 0;
    }
    console.log(Math.min(sum*2-1 , t.length));
})


//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
	};
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
	var N = nextInt();
	var list = nextIntArray();
	var max = Math.max.apply(null, list);
	if(max <= 25){
		myout(0);
	}else{
		myout(max - 25);
	}
}


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

const isPrime = (n) => {
  let ans = true;

  for (let i = 2; i*i <= n; i++) {
    if (n % i === 0) {
      return false;
    }
  }

  return ans;
}

rl.on('line', (d) => {
  const [n, m] = d.split(' ').map(Number);
  let ans = 'NO';

  for (let i = n + 1; i <= m; i++) {
    if (isPrime(i) && i !== m) {
      break;
    }

    if (isPrime(i) && i === m) {
      ans = 'YES';
      break;
    }
  }

  console.log(ans);
});


function keyboard(direction, string) {
  let keyboard = "qwertyuiopasdfghjkl;zxcvbnm,./".split("");
  let result = "";
  let indicator = direction === "R" ? -1 : 1;
  for (let i = 0; i < string.length; i++) {
    result += keyboard[keyboard.indexOf(string[i]) + indicator];
  }
  console.log(result);
}

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

let arr = [];
rl.on("line", (line) => {
  arr.push(line);
});

rl.on("close", () => {
  keyboard(arr[0], arr[1]);
});


const readline = require('readline');
const rl = readline.createInterface({input: process.stdin});
let stdin = [];
rl.on('line', function (line) {stdin.push(line);});
rl.on('close', main);

// let stdin = [
//   // '512 4',
//   // '1000000000 9',
// ]
// main();

function main() {
  let [n, k] = stdin[0].split(' ');
  for (let i = 1; i<=Number(k); i++) {
    const lastDigit = n[n.length - 1];
    if(lastDigit !== '0') {
      n = String(Number(n) - 1);
    } else {
      n = n.slice(0, -1);
    }
  }
  console.log(n)
}