//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 count = [0, 0, 0];
  for(var i = 0; i < N; i++){
    count[i % 3] += list[i];
  }
  if(count[0] > count[1] && count[0] > count[2]){
    myout("chest");
  }else if(count[0] < count[1] && count[1] > count[2]){
    myout("biceps");
  }else{
    myout("back");
  }
}


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

rl.on('line', (str) => {
  let L = 0;
  let R = str.length - 1;
  let ans = '';

  while (L <= R) {
    if (L !== R) {
      if (str.length % 2 === 0) {
        ans += str[R];
        ans += str[L];
      }
      else {
        ans += str[L];
        ans += str[R];
      }
    }
    else {
      ans += str[L];
    }

    L++;
    R--;
  }

  console.log([...ans].reverse().join(''));

  c++;
});


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

function* nextLine() {
	let lines = data.trim().split(/\n/g);
	for(let l of lines){
		yield l.trim();
	}
}

let nl = nextLine();

nl.num = function() {
		return Number(this.next().value);
	};
nl.nums = function() {
		return this.next().value.split(/\s/g).map(Number);
	};
nl.line = function() {
		return this.next().value;
	}

const sol = () => {
	let [x, y] = nl.nums();
	ans = ['1/1', '5/6','2/3','1/2','1/3','1/6'];
	console.log(ans[Math.max(x,y)-1]);

};

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


const readline = require('readline');

const INPUT = 'test.in';
const LOCAL = process.env.ENABLE_LOCAL_ENV === 'true';
const log = (...args) => {
    LOCAL && console.log(...args)
};
let rl;
let lineNr = 0;

/**
 * MAIN
 */
(async () => {
    const promises = await setup(INPUT);
    await Promise.all(promises);
})();

function setup() {
    const promises = []
    rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout,
        terminal: false,
    });

    rl.on('line', (line) => {
        promises.push(work(line, lineNr));
        lineNr++;
    });

    rl.on('error', (err) => {
        log('Error:', err);
    });

    return new Promise(res => {
        rl.on('close', () => {
            res(promises)
            log('Done!');
        });
    });
}

async function work(line, lineNr) {
    const solutionForLine = await solve(line.trim());
    const responseLine = `${solutionForLine}\n`;
    process.stdout.write(responseLine);
}

/**
 *
 * Solution goes below
 *
 */
function solve(line) {
    const [n, m, a] = line.split(' ').map(n => parseInt(n));
    return Math.ceil(n / a) * Math.ceil(m / a);
}


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

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

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

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

  let ans = 'Tie';
  let score1 = 0;
  let score2 = 0;
  let spentTime = 0;

  for (let i = 0; i < n; i++) {
    spentTime += t[i];
    score1 += Math.max(0, p[i] - c * spentTime);
  }

  spentTime = 0;
  for (let i = n - 1; i >= 0; i--) {
    spentTime += t[i];
    score2 += Math.max(0, p[i] - c * spentTime);
  }

  if (score1 > score2) {
    ans = 'Limak';
  }

  if (score2 > score1) {
    ans = 'Radewoosh';
  }

  console.log(ans);

  count++;
});


'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
  const s = readline();
  const t = readline();

  let pos = 0;
  for (let i = 0; i < t.length; i++) {
    if (t.charAt(i) === s.charAt(pos)) {
      pos++;
    }
  }
  // output
  print(pos + 1);
}


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 t = +readLine();
  while (t--) {
    const num = readLine();
    const count = { 1: 1, 2: 3, 3: 6, 4: 10 };
    const len = count[num.length];
    const n = Math.abs(+num[0] - 1) * 10;

    console.log(len + n);
  }
}


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

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

  b = d;

  for (let i = 0; i < a.length; i++) {
    ans += a[i] ^ b[i];
  }

  console.log(ans);

  c++;
});


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

rl.on('line', (d) => {
  const [n, m] = d.split(' ').map(Number);
  let ans = 0;
  ans += n;
  let add = Math.floor(n / m);
  ans += add;
  let secondAdd = Math.floor(ans / m);

  while (add !== secondAdd) {
    ans += secondAdd - add;

    add = secondAdd;
    secondAdd = Math.floor(ans / m);
  }

  console.log(ans);
});


'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 readAsInt(){
  return parseInt(readline());
}

function readAsIntList(){
  return readline().split(' ').filter(i => i).map(i => parseInt(i));
}

// Make a Snippet for the code above this and then write your logic in main();

function main() {
  let x = readAsInt();
  console.log((x >= 5 ? (x - (x % 5)) / 5 : 0) + (x % 5 > 0 ? 1 : 0));
}


var input = ''
process.stdin.on('data', c => input += c)
process.stdin.on('end', () => {
  console.log(Math.floor(input.split(' ').reduce((a, v) => a * v, 1) / 2))
})


// 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 frnLocation = str.trim();
    let moves = [1, 2, 3, 4, 5];
    let steps = [];
    for (let i = moves.length - 1; i >= 0; i--) {
        if (frnLocation % moves[i] === 0) {
            steps.push(Math.floor(frnLocation / moves[i]));
            break;
        } else {
            steps.push(Math.floor(frnLocation / moves[i]) + 1);
            break;
        }
    }
    return steps.toString();
}


// Lang: Node.js
'use strict';
let x = '', y = 0;
let print = x => console.log(x);

process.stdin.on('data', inputStdin => x += inputStdin);
process.stdin.on('end', () => { x = x.split('\n'); main(); });
let readline = () => x[y++];

// ************************ Code Start ***************************

function main() {

  var ar = readline().split(" ");
  var n = ar[0], m = ar[1];

  if (9 * n < m || (m == 0 && n > 1)) print(-1 + " " + -1);
  else {
    var mx = "", mm = m, nn = n;
    while (nn) {
      mx += Math.min(9, mm);
      mm -= Math.min(9, mm);
      nn--;
    }
    var mn = "", nn = n, mm = m;
    while (nn) {
      var res = Math.max(mm - (nn - 1) * 9, 0);
      if (!res && nn == n && mm > 0) res = 1;
      mn += res;
      mm -= res;
      nn--;
    }
    print(mn + " " + mx);
  }
}


const readline = require('readline');

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

function getACount(str) {
  return str.split('').reduce( (result, char) => {
    if (char === 'a') return result+1;
    else return result;
  }, 0);
}
rl.on('line', (str) => {
  const a_count = getACount(str);
  const other_count = str.length - a_count;
  let result;
  if (a_count > other_count) {
    result =  str.length;
  } else {
    const char_to_delete = other_count - a_count + 1;
    result = str.length - char_to_delete;
  }
  console.log(result);
  rl.close();

});


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));
});


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

rl.on('line', function (line) {
    console.log(dividable(parseInt(line)) ? 'YES' : 'NO');
    rl.close()
})

function dividable(w) {
    return (w != 2 && (w % 2) === 0);
    // let part = 0;
    // while (part <= w) {
    //     if (((w - part) % 2) === 0) return true;
    //     part += 2;
    // }
    // return false;
}


const readline = require('readline')

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

let input = []

rl.on('line', line => {
  input = line.split(' ').map(x => parseInt(x))
  const output = solution(...input)
  console.log(output)
})

rl.on('close', () => {
  // console.log(input)
})

function solution(num, times) {
  for (let i=0; i<times; i++) {
    if (num % 10) {
      num = num - 1
    } else {
      num = num / 10
    }
  }
  return num
}


// https://codeforces.com/problemset/problem/977/B
// Big O:
// Time complexity: O(n)
// n: string length
// 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] : 0;
        const currentOcurrences = occurrences + 1;
        if (currentOcurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = currentOcurrences;
        }

        gramOccurrences[twogram] = currentOcurrences;
    }

    return mostCommonGram;
}


//Queue at the School

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

let inp = '';

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

process.stdin.on('end', () => {
    let lines = inp.split(EOL);

    let t = +lines[0].split(' ')[1];
    let init = lines[1].split('');

    let iter = str =>  {
    	for(let i = 0; i < str.length - 1; i++)  {
    		if(str[i] == 'B')  {
    			if(str[i + 1] == 'G')  {
    				str[i] = 'G';
    				str[i + 1] = 'B';
    				i++;
    			}
    		}
    	}
    	return str;
    }

    for(let i = 0; i < t; i++)  {
    	init = iter(init);
    }

    process.stdout.write(init.join(''));

    return;
});


const readline = require('readline');

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

rl.question('', (input) => {
  const [n, m, a] = input.split(' ')
  console.log(Math.ceil(n/a) * Math.ceil(m/a));
  rl.close();
});


process.stdin.resume();
process.stdin.setEncoding('utf8');

let inputString = "";
let currentLine = 0;

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

process.stdin.on('end', () => {
    inputString = inputString.trim().split(" ");
    main();
});

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

function getChange(string) {
    string = string.toLowerCase();
    resStr = "";
    for(let i=0; i<string.length; i++) {
        if(string.charAt(i) == 'a' || string.charAt(i) == 'e' || string.charAt(i) == 'i' || string.charAt(i) == 'o' || string.charAt(i) == 'u' || string.charAt(i) == 'y') {
            continue;
        } else {
            resStr += '.' + string.charAt(i);
        }
    }
    return resStr;
}

function main() {
    let string = readLine();
    let resultedString = getChange(string);
    console.log(resultedString);
}


'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 firstString=readLine().toLowerCase()
	let secondString=readLine().toLowerCase()

	if(firstString<secondString)
		console.log(-1)
	else if(firstString>secondString)
		console.log(1)
	else console.log(0)
}


let data = '';
process.stdin.on('data', c => data += c);
const sol = () => {
    let n = Number(data);
    let ans = 0; //[0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 15, 4];
    if (n - 10 <= 0 || n - 10 > 11) {
        ans = 0;
    } else if (n - 10 === 10){
        ans = 15
    } else {
        ans = 4;
    }
    console.log(ans);
}

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


//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 N = nextInt();
  var list = nextIntArray();
  list.sort(function(a,b){
  	return a - b;
  });
  var map = {};
  for(var i = 0; i < N; i++){
    if(list[i] != -1){
      var div = list[i];
      map[list[i]] = [];
      for(var j = i; j < N; j++){
        if(list[j] % div == 0){
          list[j] = -1;
        }
      }
    }
  }
  myout(Object.keys(map).length);
}


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

var arr = ''
process.stdin.on('data', (i) => {
  arr += i
})

process.stdin.on('end', () => {
  arr = arr.split('\n').map(a => a.replace(/(\r\n|\n|\r)/gm, ''))

  let [a, b, c, d, e, f] = arr.map(a => parseInt(a))
  let cost = 0

  if(e > f) {
    if(a < d) {
      cost += e * a
      d -= a
      a = 0
    }
    else {
      cost += e * d
      a -= d
      d = 0
    }

    cost += Math.min(b, c, d) * f
  }
  else {

    if(b <= c && b <= d) {
      cost += f * b
      c -= b
      d -= b
      b = 0
    }

    else if(c <= b && c <= d) {
      cost += f * c
      b -= c
      d -= c
      c = 0
    }

    else {
      cost += f * d
      c -= d
      b -= d
      d = 0
    }

    cost += Math.min(a, d) * e
  }

  console.log(cost)
})


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

var templateString = ""

var c = 0;
rl.on('line', function (line) {
    c += 1;
    if (c == 1) {
        templateString = line;
        rl.close();
        var _p = parse(templateString, 2)
        console.log(result(parseInt(_p[0]), parseInt(_p[1])));
    }
});

function parse(template, iLoop) {
    var out=[]
    var regex = /\d+/gm;
    var str = template;
    var m;
    var c = 0;
    while ((m = regex.exec(str)) !== null) {
        if (m.index === regex.lastIndex) {
            regex.lastIndex++;
        }
        if (c==iLoop) {break}
        out[c] = m[0];
        c+=1;
    }
    return out;
}

function result(n,k) {
    var min = n>k ? k : n;
    min = n>=k ? min - 1 : min;
    var start = k - n;
    start = start <= 0 ? 1 : start >= n ? n : start;
    return Math.floor((min - start + 1) / 2);
}


'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 readAsInt(){
  return parseInt(readline());
}

function readAsIntList(){
  return readline().split(' ').filter(i => i).map(i => parseInt(i));
}

// Make a Snippet for the code above this and then write your logic in main();

function main() {
  let l = readAsInt();
  let word = readline();
  let match = word.matchAll(/[R]{2,}|[G]{2,}|[B]{2,}/g);
  console.log([...match].map(g => g[0].length - 1).reduce((acc, n) => acc + n, 0));
}


// https://codeforces.com/problemset/problem/339/A

function main(stdin) {
  process.stdout.write(stdin[0].split('+').sort().join('+') + '')
}

// Handle standard input
process.stdin.resume()
process.stdin.setEncoding('utf-8')

let inputString = ''

process.stdin.on('data', (inputStdin) => inputString += inputStdin)
process.stdin.on('end', () =>
  main(inputString.trim().split('\n').map(s => s.trim())))


const readline = require('readline');

const rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout
});
var str;
function main() {
	rl.question('', (answer) => {
		if (answer.length) {
			//console.log(answer);
			str = answer;
			//main();
		//} else {
			rl.close();
			solve();
		}
	});
}
function solve() {
	//console.log('tchau');
	var cont = 1;
	var f = true;
	for(var i=1; i<str.length; i++){
		if(str[i] == str[i-1]) cont++; else cont = 1;
		if(cont == 7) f = false;
	}
	if(f) console.log("NO"); else console.log("YES");
}
main();


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

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

readLine.on('close', () => {
  let [a, b] = input[0].split(' ').map(x => parseInt(x));

  let c = parseInt((Math.max(a, b) - Math.min(a, b)) / 2);
  console.log(`${Math.min(a, b)} ${c}`)
});


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

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

function processData(input1) {
    let input = input1.trim()
    let vowels = "aeiouy"
    let result = ""
     for(let i=0;i<input.length;i++) {
         if (vowels.indexOf(input[i].toLowerCase()) === -1) {
              result = result + "." + input[i].toLowerCase()
         }
     }
     console.log(result)
}


const readline = require('readline');

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

rl.on('line', (input) => {
    let ans = 0, temp = input.split(' ').map(item => parseInt(item));
    let N = temp[0], M = temp[1];

    if (N % 2 == 0 || M % 2 == 0)
        ans = (N % 2 != 0) ? M / 2 * N : N / 2 * M;

    else
        ans = parseInt(N / 2) * M + parseInt(M / 2);

    console.log(ans);
    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();
});

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

const main=()=>{
	let x=readLine()
	let uc=0,lc=0
	for(let char of x)
		if(char==char.toUpperCase())
			uc++
		else lc++

	if(lc==uc || lc > uc)
		console.log(x.toLowerCase())
	else console.log(x.toUpperCase())
}


const readline = require('readline');

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

let card, hand;

rl.on('line', (line) => {
  !card ? card = new Set(line) : hand = new Set(line.replace(/\s/g, ''));
  if (card && hand) {
    for (const char of hand) {
      if (card.has(char)) {
        rl.close();
        return console.log('YES');
      }
    }
    rl.close();
    return console.log('NO');
  }
});


function bautifulMartix(matrix) {
  // determine the location of the current 1 point
  let coordinates = [];
  for (let row = 0; row < matrix.length; row++) {
    for (let col = 0; col < matrix[row].length; col++) {
      if (matrix[row][col] == "1") {
        coordinates.push(row);
        coordinates.push(col);
      }
    }
  }
  console.log(Math.abs(coordinates[0] - 2) + Math.abs(coordinates[1] - 2));
}

const readline = require("readline");
// Create readline Interface
let inputs = [];
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
rl.on("line", (lineInput) => {
  inputs.push(lineInput);
});
rl.on("close", () => {
  // call the function
  let matrix = [];
  inputs.forEach(function (el) {
    matrix.push(el.split(" "));
  });
  bautifulMartix(matrix);
});


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 s = readLine().split("+").map(Number);

  s.sort((a, b) => {
    return a - b;
  });

  const result = s.join("+");

  console.log(result);
}


const readline = require('readline');

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

var GCD=function(a, b){
    if( b==0) return a;
    return GCD(b, a%b);
}

/**
 *
 * while(true){
 *   string input= Console.ReadLine();
 * }
 */
rl.on('line', (input) => {
    let temp = input.split(' ').map(item=>parseInt(item));
    let y=temp[0],w=temp[1];
    let maxRoll=(y>w)?y:w;
    let dotChance=6-maxRoll+1;
    let gcd=GCD(dotChance,6);
    console.log("%d/%d",dotChance/gcd,6/gcd);
    rl.close();

  });


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

const input = [];
readLine.on('line', line => input.push(line));
const queue = () => {
    let [n,t] = input[0].split(' ').map(x => +x);
    let s = Array.from(input[1]);
    for (let i = 0; i < t; i++) {
        for (let j = 1; j < n; j++) {
            if (s[j - 1] === 'B' && s[j] === 'G') {
                [s[j - 1], s[j]] = [s[j], s[j - 1]];
                j++;
            }
        }
    }
    console.log(s.join(''));
};

readLine.on('close', queue);


readline = require('readline')
let stdinInput = '';

// //file
//     var fs = require('fs');
//    const inputfile = '_in.txt';
//    const outputfile = '_out.txt';
//    fs.writeFileSync(outputfile, '');
//    var myInterface = readline.createInterface({
//      input: fs.createReadStream(inputfile),
//    });
//    myInterface.on('line', function (line) {
//       stdinInput += line+'\n';
//     }).on('close', () => {
//            main();
//         process.exit(0);
//     })
   /*
   *  Api Scanner
   */
  class Scanner {
    constructor() {
      this.index = -1;
      this.lines = stdinInput.trim().split('\n'); // eslint-disable-line
    }

    nextLine() {
      this.index += 1;
      return this.lines[this.index].trim();
    }
    nextArray(fn) {
      const array = this.nextLine().split(' ');
      return fn === String ? array : array.map(fn);
    }

    hasNext() {
      return this.index < this.lines.length;
    }
  }

  process.stdin.resume();
  process.stdin.setEncoding('utf-8');
  process.stdin.on('data', (input) => { stdinInput += input; });
  process.stdin.on('end', () => { main(); });

var n;
function main() {
    const is = new Scanner();

    // const s = is.nextArray(Number);
    // const t = is.nextArray(Number);
    // // const k = is.nextArray();

    n = parseInt(is.nextLine());
    // console.log(n);

    if(kt()==1)
        console.log("YES");
		else
        console.log("NO");
  }

  function kt(){
    for(var i=2; i<n; i=i+2)
	{
		if((n-i)%2==0)
			return 1;
	}
	return 0;
}


//158A
const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
let i = 0
let partPlace;
let scores = []
rl.on('line', (input) => {
i++
    if(i==1) {
        let msg = input.split(" ")
        partPlace = msg[1]
    } else {
        rl.close()
        scores = input.split(" ")
        let partPlaceScore = scores[partPlace - 1]

            let i = 0
            scores.forEach(function(score) {
                let blep = parseInt(score)
                if (blep >= partPlaceScore && blep > 0) {
                    i++
                }
            })
            console.log(i)

    }

});


process.stdin.setEncoding('utf8');
let input = [];
process.stdin.on('readable', () => {
    const chunk = process.stdin.read();
    if (chunk !== null) {
        let re = /\n\s*| /;
        input = chunk.split(re).slice(0, -1);
        let myinput = input.map(value => parseInt(value));
        console.log(snowball.apply(null, myinput));
        process.exit(0);
    }
});

function snowball(weight, height, u1, d1, u2, d2) {
    let w = weight, h = height;
    for (; h >= 0; h--) {
        w += h;
        if (h == d1) w -= u1;
        if (h == d2) w -= u2;
        if (w < 0) w = 0;
    }
    return w;
}


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

    this.solveCase = function() {
        var res , i , j , fl , cn , temp ;
        res = 0 ;
        for( i = 0 ; i < this.w ; i++ ) {
        	res += ( ( i + 1 ) * this.k ) ;
        }
        if( res <= this.n ) {
        	res = 0 ;
        }
        else {
        	res = res - this.n ;
        }
        print( res );
    };

    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.k = irObj.nextInt();
            this.n = irObj.nextInt();
            this.w = irObj.nextInt();
        }
        catch( ex ) {
            hasMoreInput = false;
        }
        return hasMoreInput;
    };

    this.clearArraysPerCase = function() {
        var i;
        this.arr = new Array();
        this.adj_list = new Array();
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.arr.push( 0 );
            this.adj_list.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.adj_list = 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.adj_list.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;
        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;
        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() {
        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 && readline != null && typeof( readline ) != 'function' ) {
                    environmentType = 'local-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 testCases , i , hasMoreTestCases , isLocal , 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();


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

const store = {};

function main() {
	let [n, m] = readLine()
		.split(' ')
		.map(x => x >> 0);

	if (m > n) {
		console.log(-1);
		return;
	}

	let steps = (n & 1) === 0 ? n >> 1 : (n >> 1) + 1;

	if (steps % m === 0) {
		console.log(steps);
		return;
	}

	let found = false;
	while (steps <= n) {
		steps++;
		if (steps % m === 0) {
			found = true;
			break;
		}
	}

	found ? console.log(steps) : console.log(-1);
}


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

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

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

  arr2 = d.split(' ').map(Number);
  let ans = 0;

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

  for (let i = 0; i < arr2.length; i++) {
    ans -= arr2[i];
  }

  if (ans >= 0) {
    console.log('YES');
  }
  else {
    console.log('NO');
  }

  c++;
});


const readline = require('readline');

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

rl.on('line', (input) => {
  let len=input.length;
  let met=false;
  let ans="";
  for(let i=0;i<len-1;i++){
      if(input[i]=='/' && input[i+1]!='/')
         ans+="/";
      else if(input[i]!='/'){
        ans+=input[i];
        met=true;
      }

  }

  if(!met || input[len-1]!='/')
          ans+=input[len-1];

  console.log(ans);
    rl.close();

});


function lexicographically(str1, str2) {
  console.log(str1.toLocaleLowerCase().localeCompare(str2.toLocaleLowerCase()));
}

const readline = require("readline");
// Create readline Interface
let inputs = [];
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
rl.on("line", (lineInput) => {
  inputs.push(lineInput);
});
rl.on("close", () => {
  let firstWord = inputs[0];
  let secondWord = inputs[1];
  lexicographically(firstWord, secondWord);
});


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

// thats all what you have to write to get input from stdin, using readLine.

// Main code runs in main();

function main(){
    let onerow = 1;
    let onecol = 1

    for(var row=1; row<=5;row++)
    {
        let line = readline();
        for (let col = 0; col < line.split(" ").length; col++) {
            const element = line.split(" ")[col];
            if(element  === '1')
            {
                onerow = row;
                onecol = col + 1;
            }
        }
    }
    var res=  Math.abs(3 - onerow) + Math.abs(3 - onecol);
    process.stdout.write(res.toString());
}


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 arr = readLine().split(" ").map(Number);

  var uniqArr = [...new Set(arr)];
  console.log(4 - uniqArr.length);
}


'use strict';

let input = [];

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

RL.on('line', (line) => {
    input = line.split(' ').map(x => parseInt(x));
    let n = input[0]; let k = input[1];

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

RL.on('close', () => {
    //console.log(input);
});


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

rl.on('line', (d) => {
  const [k, n, s, p] = d.split(' ').map(Number);
  const airplanes = Math.ceil(n / s) * k;
  const ans = Math.ceil(airplanes / p);

  console.log(ans);
});


function read(cb) {
  let buffer = ''
  process.stdin.on('end', () => cb(buffer))
  process.stdin.on('data', data => buffer += data.toString())
}

read(input => {
  const [a, b] = input.split(/\W/).map(Number)
  if (a === b) {
    console.log(1)
  } else {
    console.log(Math.ceil(Math.log(b/a) / (Math.log(3) - Math.log(2))))
  }
})


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 a = parseInt(readLine());
  const b = parseInt(readLine());
  const c = parseInt(readLine());
  const maxN = Math.max(Math.max(a+b+c, a + (b * c), (a * b) + c), Math.max(a * b * c, a * ( b + c),  (a + b) * c));
  console.log(maxN);
}


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

let l = 0;
let hand = []
rl.on('line', (input) => {
    if (l === 0) {
        hand = input.split("")
     }
    else {
        rl.close();
        let arr = input.split(" ").map(x => x.split(""))
        let can =false
        for(let i=0;i<arr.length;i++){
            if(hand[0]===arr[i][0]||hand[1]===arr[i][1]){
                can=true
                break
            }
        }
        if(can)
        console.log('YES')
        else
        console.log('NO')
        return 0;
    }
    l++
})


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

function print(x) {
  console.log(x);
}
let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin;
});
process.stdin.on("end", () => {
  inputString = inputString.split("\n");
  main();
});
function readline() {
  return inputString[currentLine++];
}

// ************************ Code Start ***************************

function main() {

    var t=+readline();
    while(t--){
        var input= readline();
        var arr= input.split(" ").map(x=>+x);
        var a=arr[0];
        var b=arr[1];
        var res=1;
        for(var i=0; i<b; i++){
            res=res*a%(1000000000+7);
        }
        print(res);
    }

}