Petya studies in a school and he adores Maths. His class has been studying arithmetic expressions. On the last class the teacher wrote three positive integers a, b, c on the blackboard. The task was to insert signs of operations '+' and '*', and probably brackets between the numbers so that the value of the resulting expression is as large as possible. Let's consider an example: assume that the teacher wrote numbers 1, 2 and 3 on the blackboard. Here are some ways of placing signs and brackets:  1+2*3=7  1*(2+3)=5  1*2*3=6  (1+2)*3=9 Note that you can insert operation signs only between a and b, and between b and c, that is, you cannot swap integers. For instance, in the given sample you cannot get expression (1+3)*2.It's easy to see that the maximum value that you can obtain is 9.Your task is: given a, b and c print the maximum value that you can get.

The input contains three integers a, b and c, each on a single line (1 ≤ a, b, c ≤ 10).

Print the maximum value of the expression that you can obtain.

// 479A - Expression
// http://codeforces.com/problemset/problem/479/A

function main() {
    let a = [];
    for (let i = 0; i < 3; i++) {
        a.push(parseInt(read()));
    }
    writeline(Math.max(
        a[0] + a[1] + a[2],
        a[0] * (a[1] + a[2]),
        (a[0] + a[1]) * a[2],
        a[0] * a[1] * a[2]));
    return 0;
}

var input = "";
var read;
var writeline = (x) => process.stdout.write(x + "\n");
var write = (x) => process.stdout.write(x);
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", (chunk) => input += chunk);
process.stdin.on("end", () => {
    input = input.trim().split(/\s+/);
    read = () => input.shift();
    process.exit(main() || 0);
});

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

readline.question("", (a) => {
    readline.question("", (b) => {
        readline.question("", (c) => {
            a=parseInt(a)
            b=parseInt(b)
            c=parseInt(c)
            console.log(Math.max(a + b + c, a + b * c, (a + b) * c, a * b + c, a * (b + c), a * b * c))
            readline.close();
        })
    })
})

var a = +readline(), b = +readline(), c = +readline(), max = 0;

max = ( (a+b+c) > max ) ? (a+b+c) : max;
max = ( (a*b*c) > max ) ? (a*b*c) : max;
max = ( ((a*b)+c) > max ) ? ((a*b)+c) : max;
max = ( (a+(b*c)) > max ) ? (a+(b*c)) : max;
max = ( ((a+b)*c) > max ) ? ((a+b)*c) : max;
max = ( (a*(b+c)) > max ) ? (a*(b+c)) : max;
write(max);

a=+readline();b=+readline();c=+readline();
function x(l,r) { return (function (lb) { return r === 1 ? lb + 1 : lb * r })((l === 1 || b === 1) ? l + b : l * b); }
print(a < c ? x(a, c) : x(c, a))

a=+readline();b=+readline();c=+readline();

if (a > c) { x = c; c = a; a = x; }
print((function (ab) { return c === 1 ? ab + 1 : ab * c })((a === 1 || b === 1) ? a + b : a * b))

var inp = [];
inp.push(parseInt(readline()));
inp.push(parseInt(readline()));
inp.push(parseInt(readline()));
var M = Math;
var sortF = function(a,b){return a > b;};

var res = M.max(inp[0]*inp[1]*inp[2], inp[2]*(inp[0]+inp[1]), inp[0] + inp[1] + inp[2], inp[0] * (inp[2] + inp[1]));

print(res);

function expression(a, b,c) {
    const ab = a+b;
    const bc = b+c;
    const abc = a+b+c;
    return Math.max(ab*c,a*bc,abc,a*b*c);
}

const a = parseInt(readline());
const b = parseInt(readline());
const c = parseInt(readline());

print(expression(a,b,c));

var n1 = parseInt(readline());
var n2 = parseInt(readline());
var n3 = parseInt(readline());

var sort = function(a,b){
    return b - a;
}

var array = [];

array.push(n1+(n2*n3));
array.push(n1+n2+n3);
array.push(n1*(n2+n3))
array.push(n1*n2*n3);
array.push((n1+n2)*n3);

array = array.sort(sort);

print(array[0]);

//var inputs = readline().split(" ").map(function(x) { return parseInt(x); });
var iPreNum = Number(readline().split(" ").map(function(x) { return parseInt(x); }));
var iMidNum = Number(readline().split(" ").map(function(x) { return parseInt(x); }));
var iFrontNum = Number(readline().split(" ").map(function(x) { return parseInt(x); }));

var iSum = [];
iSum[0] = iPreNum + iMidNum + iFrontNum;
iSum[1] = (iPreNum + iMidNum) * iFrontNum;
iSum[2] = iPreNum * (iMidNum + iFrontNum);
iSum[3] = iPreNum * iMidNum * iFrontNum;

var iFinalAns = iSum[0];

for (var i = 1; i <= 3; i++) {
	if (iFinalAns < iSum[i])
		iFinalAns = iSum[i];
}

print(iFinalAns + "\n");

(function () {

	print(function (a, b, c) {

		return Math.max(
			a * b * c,
			(a + b) * c,
			a * (b + c),
			a + b + c
		);

	}(+readline(), +readline(), +readline()));

}.call(this))

var a = parseInt(readline());
var b = parseInt(readline());
var c = parseInt(readline());

max = a+b+c;

if((a+b*c)>max){
    max = a+b*c;
}
if(((a+b)*c)>max){
    max = (a+b)*c;
}
if((a*b+c)>max){
    max = a*b+c;
}
if((a*(b+c))>max){
    max = a * (b+c);
}
if((a*b*c)>max){
    max = a*b*c;
}
print(max);

var a = +readline();
var b = +readline();
var c = +readline();
var list = [
	a + ( b * c ),
	a * ( b + c ),
	a * b * c,
	a + b + c,
	( a + b ) * c,
];

print(Math.max.apply(Math,list));

var a = Number(readline());
var b = Number(readline());
var c = Number(readline());

res = Math.max(
        a+b+c,
        (a+b)*c,
        a*(b+c),
        a*b*c
    );

print(res);

var a=Number.parseInt(readline()),b=Number.parseInt(readline()),c=Number.parseInt(readline())
var ok=a+b+c
ok=Math.max(ok,a*b+c)
ok=Math.max(ok,a+b*c)
ok=Math.max(ok,(a+b)*c)
ok=Math.max(ok,a*(b+c))
ok=Math.max(ok,a*b*c)
print(ok)

(function () {
    var a = parseInt(readline()),
        b = parseInt(readline()),
        c = parseInt(readline());
    if ((a !== 1) && (b !== 1) && (c !== 1)) {
        print(a * b * c);
    } else if ((a === 1) && (b === 1) && (c === 1)) {
        print(a + b + c);
    } else if ((a === 1) && (c === 1)) {
        print(a + b + c);
    } else if (a === 1) {
        print((a + b) * c);
    } else if (c === 1) {
        print(a * (b + c));
    } else {
        if (a > c) {
            print(a * (b + c));
        } else {
            print((a + b) * c);
        }
    }
})();

(function () {
    var a = parseInt(readline()),
        b = parseInt(readline()),
        c = parseInt(readline());
    if ((a !== 1) && (b !== 1) && (c !== 1)) {
        print(a * b * c);
    } else if ((a === 1) && (c === 1)) {
        print(a + b + c);
    } else if (a === 1) {
        print((a + b) * c);
    } else if (c === 1) {
        print(a * (b + c));
    } else {
        if (a > c) {
            print(a * (b + c));
        } else {
            print((a + b) * c);
        }
    }
})();

var x = parseInt(readline());
var y = parseInt(readline());
var z = parseInt(readline());
print(Math.max( x*y*z , (x+y)*z , x*(y+z) , x+y+z))

function expression(a,b,c){
    var totalEx1 = a+(b*c),
    totalEx2 = a*(b+c),
    totalEx3 = a*b*c,
    totalEx4 = (a+b)*c,
    totalEx5 = a+b+c;
    if (totalEx1 >= totalEx2 && totalEx1 >= totalEx3 && totalEx1 >= totalEx4 && totalEx1 >= totalEx5) {
        return totalEx1;
    }else if (totalEx2 >= totalEx1 && totalEx2 >= totalEx3 && totalEx2 >= totalEx4 && totalEx2 >= totalEx5) {
        return totalEx2;
    }else if (totalEx3 >= totalEx1 && totalEx3 >= totalEx2 && totalEx3 >= totalEx4 && totalEx3 >= totalEx5) {
        return totalEx3;
    }else if (totalEx4 >= totalEx1 && totalEx4 >= totalEx2 && totalEx4 >= totalEx3 && totalEx4 >= totalEx5) {
        return totalEx4;
    }else if (totalEx5 >= totalEx1 && totalEx5 >= totalEx2 && totalEx5 >= totalEx3 && totalEx5 >= totalEx4) {
        return totalEx5;
    }

}
a = readline()
b = readline()
c = readline()
print(expression(parseInt(a),parseInt(b),parseInt(c)));

var a = parseInt(readline()),
b = parseInt(readline()),
c = parseInt(readline()),
firstExp = a + b * c,
secondExp = a * (b +c),
thirdExp = a * b * c,
fourthExp = (a + b) * c,
fifthExp = a + b + c,
max = 0;
if(max < firstExp){
    max = firstExp;
}

if(max < secondExp){
    max = secondExp;
}

if(max < thirdExp){
    max = thirdExp;
}

if(max < fourthExp){
    max = fourthExp;
}

if(max < fifthExp){
    max = fifthExp;
}

print(max);

'use strict';

(function() {
    let a = parseInt(readline()),
        b = parseInt(readline()),
        c = parseInt(readline());

    function calculateMax(a, b){
      if(a + b > a * b) {
         return a + b;
      }

      return a * b;
    }

    function getMax(a, b) {
      if ( a > b) {
        return a;
      }

      return b;
    }

    let l = calculateMax(a, b);
    let r = calculateMax(b, c);

    let lc = calculateMax(l, c);
    let ra = calculateMax(r, a);

    write(getMax(lc, ra));

})();

var dato1 =parseInt(readline());
var dato2=parseInt(readline());
var dato3=parseInt(readline());

var resultado=[];
var operacion1= dato3 * (dato1 + dato2);
resultado.push(operacion1);
var operacion2= dato1 * (dato2 + dato3);
resultado.push(operacion2);
var operacion3= dato1+dato2+dato3;
resultado.push(operacion3);
var operacion4= dato1*dato2*dato3;
resultado.push(operacion4);

resultado.sort(function(a, b){return b-a});

print(resultado[0]);

var a = readline();
var b = readline();
var c = readline();
var max = 0;
var max1=0;
var x = 0;
var abc = [a,b,c];
for (i in abc){
	abc[i]=parseInt(abc[i]);
}
if((abc[0] + abc[1])>=(abc[1] * abc[0])) max = abc[0] + abc[1];
else max = abc[0] * abc[1];
if((abc[2] + max)>=(abc[2] * max)) max = abc[2] + max;
else max = abc[2] * max;
if((abc[2] + abc[1])>=(abc[1] * abc[2])) max1 = abc[2] + abc[1];
else max1 = abc[2] * abc[1];
if((abc[0] + max1)>=(abc[0] * max1)) max1 = abc[0] + max1;
else max1 = abc[0] * max1;
if(max1>max) max = max1;
print(max);

var a = parseInt(readline());
var b = parseInt(readline());
var c = parseInt(readline());
print(Math.max(a*b*c,a*b+c,a+b+c,a+b*c,(a+b)*c,a*(b+c)));

	 var a = 0; var b = 0; var c =0;
	 for (var i=0; i<3; i++){
			var x = +readline();
			if(i==0) a = x;
			else if (i==1) b =x;
			else c = x;
	 }
	 var arr = [];
	 arr[0] = a+b*c;
	 arr[1] = a*(b+c);
	 arr[2] = a*b*c;
	 arr[3] = (a+b)*c;
	 arr[4] = a+b+c;
	print(Math.max.apply(this, arr));

const start=(main, readlineFun, printFun) => {
  if (readlineFun && printFun) {
    main(readlineFun, printFun);
    return;
  }

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

  let input = '',
    readline,
    print;

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

  process.stdin.on('end', function() {
    input = input.split('\n');
    print = function(data) {
      process.stdout.write(data + '\n');
    };
    let inputLineIndex = 0;
    readline = function() {
      return inputLineIndex >= input.length ? undefined : input[inputLineIndex++];
    };
    process.exit(main(readline, print) || 0);
  });
}
 function main(readline, print) {
  const a = parseInt(readline());
  const b = parseInt(readline());
  const c = parseInt(readline());

  let max = Math.max(a + b + c, (a + b) * c, a + b * c, a * b + c, a * (b + c), a * b * c);

  print(max);
}
 start(main);

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

let input = [];

rl.on('line', function(line) {
	input.push(line);
	if (input.length === 3) {
		expression(input);
		rl.close();
	}
});

let expression = (input) => {
	//1+2+3 _ 1*2*3 _ (1+2)*3  _ 1*(2+3)    _ 1*2+3 _ 1+2*3
	input = input.map((el) => {
		return el * 1;
	});

	let val = [
		input[0] + input[1] + input[2],
		input[0] * input[1] * input[2],
		(input[0] + input[1]) * input[2],
		input[0] * (input[1] + input[2]),
		input[0] * input[1] + input[2],
		input[0] + input[1] * input[2]
	];

	var max = val.reduce(function(a, b) {
		return Math.max(a, b);
	});

	console.log(max);
};

const readline = require('readline');

let inputs = [];

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

// Read Inputs
rl.on('line', lineInput => {
    inputs.push(lineInput)
})

rl.on('close', () => {

    const nums = inputs.map(num => parseInt(num));

    let maxValue = nums[0] * (nums[1] + nums[2]);

    maxValue = Math.max(maxValue, (nums[0] * nums[1]) * nums[2])
    maxValue = Math.max(maxValue, (nums[0] + nums[1]) + nums[2])
    maxValue = Math.max(maxValue, (nums[0] + nums[1]) * nums[2])

    console.log(maxValue)
})

const input = [];

function splitAndParseInt(line) {
  return line.split(" ").map((x) => parseInt(x));
}

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

readLine.on("line", (line) => {
  input.push(line);
});

readLine.on("close", () => {
  const a = parseInt(input[0]);
  const b = parseInt(input[1]);
  const c = parseInt(input[2]);

  console.log(
    Math.max(
      a + b + c,
      a * b * c,
      a * (b + c),
      (a + b) * c,
      a * (c + b),
      (a + b) * c
    )
  );
});

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

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

readLine.on('close', () => {
  const a = parseInt(input[0]);
  const b = parseInt(input[1]);
  const c = parseInt(input[2]);

  let max  = a + b + c;
  if (a * b * c > max) max = a * b * c;
  if ( (a + b) * c > max) max = (a + b) * c;
  if ( a * (b + c) > max) max = a * (b + c);

  console.log(max);
});

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 = readLine() >> 0;
	const b = readLine() >> 0;
	const c = readLine() >> 0;

	let values = [];
	values.push(a + b + c);
	values.push(a * (b + c));
	values.push(a * b + c);
	values.push((a + b) * c);
	values.push(a + b * c);
	values.push(a * b * c);

	console.log(Math.max(...values));
}

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

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

readline.on('close', () => {
    const [a, b, c] = input.map(v => parseInt(v));
    let abc = a * b * c, apbpc = a + b + c, apbc = (a + b) * c, abpc = a * (b + c);
    if (abc > apbpc && abc > apbc && abc > abpc) console.log(abc);
    else if (apbpc > abc && apbpc > apbc && apbpc > abpc) console.log(apbpc);
    else if (apbc > abc && apbc > apbpc && apbc > abpc) console.log(apbc);
    else console.log(abpc);
});

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 += 3) {
    doit(txt[i] * 1, txt[i + 1] * 1, txt[i + 2] * 1)

}

function doit(n1, n2, n3) {
    let prob = [n1 + n2 + n3,
        n1 * n2 * n3,
        n1 + n2 * n3,
        n1 * n2 + n3,
        (n1 + n2) * n3,
        n1 * (n2 + n3)
    ]
    console.log(Math.max(...prob));
}

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

a = +readline();
b = +readline();
c = +readline();
ways = [
    a+b+c,
    a+b*c,
    a*b+c,
    a*b*c,
    (a+b)*c,
    a*(b+c)
];
print(Math.max.apply(this, ways));

var n = Number(readline()), m = Number(readline()), k = Number(readline());
print(Math.max(n*(m+k), n*m*k, (n+m)*k, (n+m+k)));

var a = parseInt(readline());
var b = parseInt(readline());
var c = parseInt(readline());
var s = [];
Array.prototype.max = function() {
    return Math.max.apply(null, this);
};
s.push(a*b*c);
s.push(a+b+c);
s.push(a+b*c);
s.push(a*b+c);
s.push((a+b)*c);
s.push(a*(b+c));
print (s.max());

var a = parseInt(readline());
var b = parseInt(readline());
var c = parseInt(readline());
var r = [];
Array.prototype.max = function() {
  return Math.max.apply(null, this);
};
r.push(a*b*c);
r.push(a+b+c);
r.push(a*(b+c));
r.push((a+b)*c);
print(r.max());

var computeMax = function(arr)
    {
        var decrease = function(a, b)
            {
                return b - a;
            }
        var arrRes = [];
        arrRes.push((arr[0] + arr[1]) * arr[2]);
        arrRes.push(arr[0] * (arr[1] + arr[2]));
        arrRes.push(arr[0] * arr[1] * arr[2]);
        arrRes.push(arr[0] + arr[1] + arr[2]);
        arrRes.push(arr[0] * arr[1] + arr[2]);
        arrRes.push(arr[0] + arr[1] * arr[2]);
        arrRes = arrRes.sort(decrease);
        return arrRes[0];
    }
var arr = [];
for (var i = 1; i <= 3; i++)
    {
        input = +readline();
        arr.push(input);
    }
print(computeMax(arr));

var a = readline()*1;
var b = readline()*1;
var c = readline()*1;

var e1 = a+b*c,
	e2 = a*(b+c),
	e3 = (a+b)*c,
	e4 = a*b*c,
	e5 = a+b+c,
	e6 = a*b+c;
var arr = [e1,e2,e3,e4,e5,e6];
print(Math.max.apply(null,arr) );

var a = parseInt(readline(), 10),
    b = parseInt(readline(), 10),
    c = parseInt(readline(), 10),
    result = [];

result.push( (a+b)*c );
result.push( (a*b)+c );
result.push( a+(b*c) );
result.push( a*(b+c) );
result.push( a*b*c );
result.push( a+b+c );

print(result.sort((a,b) => a-b).pop());

var a = parseInt(readline());
var b = parseInt(readline());
var c = parseInt(readline());

print(Math.max(a + b + c, (a + b) * c, a * (b + c), a * b * c));

var v1= parseInt(readline());
var v2 = parseInt(readline());
var v3 =parseInt(readline());

var sumSum = v1+v2+v3;
var sumTimes = v1+(v2*v3);
var sumTimes01 = (v1+v2)*v3;
var timesTimes = v1*v2*v3;
var timesSum = (v1*v2)+v3;
var timesSum01 = v1*(v2+v3);

var list= [sumSum, sumTimes, sumTimes01, timesTimes, timesSum, timesSum01];

print(list.sort(function(a,b){return b-a;})[0]);

(function main() {

    var num1 = parseInt(readline());
    var num2 = parseInt(readline());
    var num3 = parseInt(readline());

    var res1 = num1 + num2 + num3;
    var res2 = num1 * num2 + num3;
    var res3 = num1 + num2 * num3;
    var res4 = num1 * num2 * num3;
    var res5 = (num1 + num2) * num3;
    var res6 = num1 * (num2 + num3);

    print(Math.max(res1, res2, res3, res4, res5, res6));

    return 0;
})();

Array.prototype.nextPermutation = function() {
   for (var i = this.length - 1; i > 0 && this[i - 1] >= this[i]; --i);
   if (i === 0) return false;
   for (var j = this.length - 1; this[i - 1] >= this[j]; --j);
   this[j] = [this[i - 1], this[i - 1] = this[j]][0];
   for (j = this.length - 1; i < j; ++i, --j) this[j] = [this[i], this[i] = this[j]][0];
   return true;
};

var values = [];
for (var i = 0; i < 3; ++i) {
   values.push(+readline());
}

var operations = ['+', '+', '*', '*'].sort();
var result = 0;

var perform = function(value1, value2, operation) {
   if (operation === '+') {
      return value1 + value2;
   } else {
      return value1 * value2;
   }
};

do {
   result = Math.max(
      result,
      perform(
         perform(values[0], values[1], operations[0]),
         values[2],
         operations[1]
      ),
      perform(
         values[0],
         perform(values[1], values[2], operations[1]),
         operations[0]
      )
   );
} while (operations.nextPermutation());

write(result);

Array.prototype.nextPermutation = function() {
  for (var i = this.length - 1; i > 0 && this[i - 1] >= this[i]; --i);
  if (i === 0) return false;
  for (var j = this.length - 1; this[i - 1] >= this[j]; --j);
  this[j] = [this[i - 1], this[i - 1] = this[j]][0];
  for (j = this.length - 1; i < j; ++i, --j) this[j] = [this[i], this[i] = this[j]][0];
  return true;
};

var values = [];
for (var i = 0; i < 3; ++i) {
  values.push(+readline());
}

var operations = ['+', '+', '*', '*'].sort();
var result = 0;

var perform = function(value1, value2, operation) {
  return operation === '+' ? value1 + value2 : value1 * value2;
};

do {
  result = Math.max(
    result,
    perform(
      perform(values[0], values[1], operations[0]),
      values[2],
      operations[1]
    ),
    perform(
      values[0],
      perform(values[1], values[2], operations[1]),
      operations[0]
    )
  );
} while (operations.nextPermutation());

write(result);

print.call(undefined, (function()    {
    var expression = [ 'a+b+c', 'a*b*c', 'a+b*c', '(a+b)*c', 'a*b+c', 'a*(b+c)' ];

    var a = parseInt(readline()),
        b = parseInt(readline()),
        c = parseInt(readline());

    if(a == b == c == 1)    {
        return 3;
    } else    {
        var result = 0;

        expression.forEach(function(s)    {
            result < eval(s) ? result = eval(s) : false;
        });

        return result;
    }
})());

var a = parseInt(readline());var b = parseInt(readline());var c = parseInt(readline()) ;

var gar = [];
gar.push(a+(b*c));
gar.push(a*(b+c));
gar.push(a*b*c);
gar.push((a+b)*c);
gar.push((a*b)+c);
gar.push(a+b+c);

	print(Math.max(...gar))

//x=readline();
var a = [];
a.push(readline());
 a.push(readline());
 a.push(readline());
/*a = a.sort(function(a,b){
    return a-b;
});*/
var max_stack = [];
//(a+b)*c
max_stack.push(parseInt((parseInt(a[0])+parseInt(a[1]))*parseInt(a[2])));
//a*(b+c)
max_stack.push(parseInt(parseInt(a[0])*((parseInt(a[1])+parseInt(a[2])))));
//a*b*c
max_stack.push(parseInt(parseInt(a[0])*parseInt(a[1])*parseInt(a[2])));

//a*b+c

max_stack.push(parseInt(parseInt(a[0])*parseInt(a[1])+parseInt(a[2])));
//a+b*c
max_stack.push(parseInt(parseInt(a[0])+parseInt(a[1])*parseInt(a[2])));
//a+b+c
max_stack.push(parseInt(parseInt(a[0])+parseInt(a[1])+parseInt(a[2])));

var maximus=-999;
for(i=0;i<max_stack.length;i++)
{
  if(maximus<max_stack[i])
  {
      maximus=max_stack;
  }
}
max_stack=max_stack.sort(function(a,b){
    return b-a;
});
print(max_stack[0]);

//for(i=0;i<a.length;i++)
//print(a[0]);

/*var k = readline();
var c = readline();
var len = 0;
for(i=c.length-1,j=0;i>=0,j<k.length;i--,j++)
{
   if(k[i]==c[j]){
       len++;
   }
}
 if(len==c.length)
 {
     print('YES')
 }
 else
 print('NO')*/

var x = parseInt(readline()),
 y = parseInt(readline()),
 z = parseInt(readline());
 print(Math.max( x*y*z , (x+y)*z , x*(y+z) , x+y+z))

'use strict';

(function() {
    let a = parseInt(readline()),
        b = parseInt(readline()),
        c = parseInt(readline());

    let array = [a,b,c];

    let str = array.join('').replace(new RegExp('1', 'g'), '');

    if(3 - str.length >= 2) {
        write(a+b+c);
        return;
    }

    let indexOfOne = array.indexOf(1);

    if(indexOfOne === -1){
        write(a*b*c);
    } else if(indexOfOne === 0) {
      write((array[0] + array[1])*array[2]);
    } else if (indexOfOne === 2) {
      write((array[2] + array[1])*array[0]);
    } else {
        array.sort((a, b) => a - b);

        write((a[0] + a[1])*a[2]);
    }

    return;

})();

var n = readline();
var res = 0;
for (var i=0; i<n; i++){
	var n = readline();
	if (n==0||n==1)
 	res+=Number(n);
	else if (res==1)
	res+=Number(n);
     else res*=Number(n);
}
print(res);

a=+readline();b=+readline();c=+readline();print((function x (ab) { return c === 1 ? ab + 1 : ab * c })((a === 1 || b === 1) ? a + b : a * b))

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

var res = 0;
for (var i=0; i<3; i++){
	var n = readline();
	if (n==0||n==1)
 	res+=Number(n);
	else if (res==1)
	res+=Number(n);
     else {res = 1;
		res*=1*Number(n);
		}
}
print(res);

var a = +readline();
var b = +readline();
var c = +readline();
var list = [
	a + ( b * c ),
	a * ( b + c ),
	a * b * c,
	a + b + c,
	( a + b ) * c,
].sort().reverse();
print(list.pop());

var a = readline()*1;
var b = readline()*1;
var c = readline()*1;

var e1 = a+b*c,
	e2 = a+(b*c),
	e3 = (a+b)*c;
	e4 = a*b*c;

if(e1 >= e2 && e1 >= e3 && e1 >= e4)
	print(e1);
else if(e2 >= e1 && e2 >= e3 && e2 >= e4)
	print(e2);
else if(e3 >= e1 && e3 >= e2 && e3 >= e4)
	print(e3);
else
	print(e4);

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(n1, n2,n3) {
    if(n1>n3){
        console.log(n1*(n2+n3));
    }else{
        console.log((n1+n2)*n3);
    }
}

var n1 = parseInt(readline());
var n2 = parseInt(readline());
var n3 = parseInt(readline());

var sort = function(a,b){
    return b - a;
}

var array = [];

array.push(n1+(n2*n3));
array.push(n1*(n2+n3))
array.push(n1*n2*n3);
array.push((n1+n2)*n3);

array = array.sort(sort);

print(array[0]);

var m = Number(readline()), n = Number(readline()), k = Number(readline());
print(Math.max(n+m*k, n*(m+k), n*m*k, (n+m)*k, (n+m+k)));

print.call(undefined, (function(a)    {
    var expression = [ 'a+b+c', 'a*b*c', 'a+b*c', '(a+b)*c', 'a*b+c', 'a*(b+c)' ];

    var b = parseInt(readline()),
        c = parseInt(readline()),
        array = [ a, b, c ];

    if(a == b == c == 1)    {
        return 3;
    } else    {
        var result = 0;

        expression.forEach(function(s)    {
            result < eval(s) ? result = eval(s) : false;
        });

        return result;
    }
}).apply(undefined, readline().split('').map(Number)));

var res = 0;
var x =0;		          ////580A
for (var i=0; i<3; i++){
	var n = readline();
	n==0||n==1? x+=Number(n):res*=Number(n)
}
 print(res+x);

'use strict';

(function() {
    let a = parseInt(readline()),
        b = parseInt(readline()),
        c = parseInt(readline());

    let array = [a,b,c];

    let str = array.join('').replace(new RegExp('1', 'g'), '');

    if(3 - str.length >= 2) {
        write(a+b+c);
        return;
    }

    let indexOfOne = array.indexOf(1);

    if(indexOfOne === -1){
        write(a*b*c);
    } else if(indexOfOne === 0) {
      write((array[0] + array[1])*array[2]);
    } else if (indexOfOne === 2) {
      write((array[2] + array[1])*array[0]);
    } else {
        array.sort((a, b) => a - b);

        write((array[0] + array[1])*array[2]);
    }

    return;

})();

(function () {
    var a = parseInt(readline()),
        b = parseInt(readline()),
        c = parseInt(readline());
    if ((a !== 1) && (b !== 1) && (c !== 1)) {
        print(a * b * c);
    } else if ((a === 1) && (b === 1) && (c === 1)) {
        print(a + b + c);
    } else if (a === 1) {
        print((a + b) * c);
    } else if (c === 1) {
        print(a * (b * c));
    } else {
        if (a > c) {
            print(a * (b * c));
        } else {
            print((a * b) * c);
        }
    }
})();

var inputs = readline().split(" ").map(function(x) { return parseInt(x); });
var n = inputs[0], m = inputs[1], a = inputs[2];

print(n + " " + m + " " + a);

	 var a = 0; var b = 0; var c =0;
	 for (var i=0; i<3; i++){
			var x = +readline();
			if(i==0) a = x;
			else if (i==2) b =x;
			else c = x;
	 }
	 var arr = [];
	 arr[0] = a+b*c;
	 arr[1] = a*(b+c);
	 arr[2] = a*b*c;
	 arr[3] = (a+b)*c;
	print(Math.max.apply(this, arr));

var a = parseInt(readline());
var b = parseInt(readline());
var c = parseInt(readline());

var max = a;

if(a==0 || b==0 || a==1 || b==1){
    max = max + b;
    if(max==0 || c==0 || max==1 || c==1){
        max = max + c;
    } else {
        max = max * c;
    }
} else{
    max = max * b;
    if(max==0 || c==0 || max==1 || c==1){
        max = max + c
    } else {
        max = max * c;
    }
}

print(max);

'use strict';

(function() {
    let a = parseInt(readline()),
        b = parseInt(readline()),
        c = parseInt(readline());

    if(a === 1 && b === 1 && c === 1) {
        write(3);
        return;
    }

    let array = [a,b,c];

    let indexOfOne = array.indexOf(1);

    if(indexOfOne === -1){
        write(a*b*c);
    } else if(indexOfOne === 0 || indexOfOne === 2) {
        write((a[0] + a[1])*a[2]);
    } else {
        array.sort((a, b) => a - b);

        write((a[0] + a[1])*a[2]);
    }

    return;

})();

var computeMax = function(arr)
    {
        var decrease = function(a, b)
            {
                return b - a;
            }
        var arrRes = [];
        arrRes.push((arr[0] + arr[1]) * arr[2]);
        arrRes.push(arr[0] * (arr[1] + arr[2]));
        arrRes.push(arr[0] * arr[1] * arr[2]);
        arrRes.push(arr[0] + arr[1] + arr[2]);
        arrRes.push(arr[0] * arr[1] + arr[2]);
        arrRes.push(arr[0] + arr[1] * arr[2]);
        arrRes = arrRes.sort(decrease);
        return arr[0];
    }
var arr = [];
for (var i = 1; i <= 3; i++)
    {
        input = +readline();
        arr.push(input);
    }
print(computeMax(arr));

var a = parseInt(readline()),
b = parseInt(readline()),
c = parseInt(readline()),
firstExp = a + b * c,
secondExp = a * (b +c),
thirdExp = a * b * c,
fourthExp = (a + b) * c,
max = 0;
if(max < firstExp){
    max = firstExp;
}

if(max < secondExp){
    max = secondExp;
}

if(max < thirdExp){
    max = thirdExp;
}

if(max < fourthExp){
    max = fourthExp;
}

print(max);

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

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

readline.on('close', () => {
    const ints = input.map(v => parseInt(v));
    if (ints[0] === 1 && ints[1] === 1 && ints[2] === 1) console.log(ints[0] + ints[1] + ints[2]);
    else if (ints.every(v => v > 1)) console.log(ints[0] * ints[1] * ints[2]);
    else if ((ints[0] + ints[1]) >= ints[2]) console.log((ints[0] + ints[1]) * ints[2]);
    else console.log(ints[0] * (ints[1] + ints[2]));
});

var res = 0;
for (var i=0; i<3; i++){
	var n = readline();
	if (n==0||n==1)
 	res+=Number(n);
	else if (res==1)
	res+=Number(n);
     else {res = 1;
		res*=1*Number(n);
		}
}
print(res);

var res =0;
for (var i=0; i<3; i++){
	var n = readline();
    if (res==0)
	res+=Number(n);
	else if (res==1)
		res+=Number(n);
		else if (n==1) res+=Number(n);
	else res*=Number(n);
}
print(res);

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+=3) {
    doit(txt[i]*1, txt[i+1] * 1,txt[i+2]*1);

}

function doit(n1, n2,n3) {
    if(n1>n3){
        console.log(n1*(n2+n3));
    }else{
        console.log((n1+n2)*n3);
    }
}

//var inputs = readline().split(" ").map(function(x) { return parseInt(x); });
var iPreNum = readline().split(" ").map(function(x) { return parseInt(x); });
var iMidNum = readline().split(" ").map(function(x) { return parseInt(x); });
var iFrontNum = readline().split(" ").map(function(x) { return parseInt(x); });

var iSum = [];
iSum[0] = iPreNum + iMidNum + iFrontNum;
iSum[1] = (iPreNum + iMidNum) * iFrontNum;
iSum[2] = iPreNum * (iMidNum + iFrontNum);
iSum[3] = iPreNum * iMidNum * iFrontNum;

var iFinalAns = iSum[0];

for (var i = 1; i <= 3; i++) {
	if (iFinalAns < iSum[i])
		iFinalAns = iSum[i];
}

print(iFinalAns + "\n");

	 var res = 0;
	 for (var i=0; i<3; i++){
		var c = +readline();
		if (res+c>res*c)
			res+=c;
		else res*=c;
	 }
	 print(res);

var res = 0;
	for (var i=0; i<3; i++){
		var str = Number(readline());
		if (str==1||i==0||str==1)
			res+=str;
		else res*= str;

	}
print(res);

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

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

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

readline.on('close', () => {
    const ints = input.map(v => parseInt(v));
    if (ints[0] === 1 && ints[1] === 1 && ints[2] === 1) console.log(ints[0] + ints[1] + ints[2]);
    else if (ints.every(v => v > 2)) console.log(ints[0] * ints[1] * ints[2]);
    else if ((ints[0] + ints[1]) >= ints[2]) console.log((ints[0] + ints[1]) * ints[2]);
    else console.log(ints[0] * (ints[1] + ints[2]));
});

Array.prototype.nextPermutation = function() {
   for (var i = this.length - 1; i > 0 && this[i - 1] >= this[i]; --i);
   if (i === 0) return false;
   for (var j = this.length - 1; this[i - 1] >= this[j]; --j);
   this[j] = [this[i - 1], this[i - 1] = this[j]][0];
   for (j = this.length - 1; i < j; ++i, --j) this[j] = [this[i], this[i] = this[j]][0];
   return true;
};

var values = [];
for (var i = 0; i < 3; ++i) {
   values.push(+readline());
}

var operations = ['+', '+', '*', '*'].sort();
var result = 0;

var perform = function(value1, value2, operation) {
   if (operations[0] === '+') {
      return value1 + value2;
   } else {
      return value1 * value2;
   }
};

do {
   result = Math.max(
      result,
      perform(
         perform(values[0], values[1], operations[0]),
         values[2],
         operations[1]
      )
   );
} while (operations.nextPermutation());

write(result);

const readline = require('readline');

let inputs = [];

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

// Read Inputs
rl.on('line', lineInput => {
    inputs.push(lineInput)
})

rl.on('close', () => {

    const nums = inputs.map(num => parseInt(num));
    const minimum = Math.min(...nums);
    const maximum = Math.max(...nums);
    let maxValue = 0;

    // If first number == 0
    if (minimum == 0) {
        if ((nums[1] * nums[2]) == 1) {
            maxValue = nums[1] + nums[2]
            return console.log(maxValue)
        } else {
            maxValue = nums[1] * nums[2]
            return console.log(maxValue)
        }
    } else if (minimum == 1) {
        const others = nums.filter(num => num != maximum).reduce((prev, curr) => prev += curr, 0)
        maxValue = maximum * others;
        return console.log(maxValue)
    } else {
        maxValue = nums.reduce((prev, curr) => prev *= curr);
        return console.log(maxValue)
    }

})

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+=3) {
    doit([txt[i]*1, txt[i+1] * 1,txt[i+2]*1].sort((a,b)=>{return a-b}));

}

function doit(tab) {
  for (let i = 0; i < 2; i++) {
      if(tab[i]==1){
          tab[i+1]+=tab[i]
      }

  }
  if(tab[tab.length-1]==1){
      tab[tab.length-2]+=tab[tab.length-1];
  }
  console.log(tab[0]*tab[1]*tab[2]);

}

const readline = require('readline');

let inputs = [];

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

// Read Inputs
rl.on('line', lineInput => {
    inputs.push(lineInput)
})

rl.on('close', () => {

    const nums = inputs.map(num => parseInt(num));
    const minimum = Math.min(...nums);
    const maximum = Math.max(...nums);
    const othersValue = nums.filter(num => num != maximum).reduce((prev, curr) => prev += curr, 0)
    let maxValue = 0;

    // If first number == 0
    if (minimum == 0) {
        if (nums.includes(1)) {
            maxValue = nums.reduce((prev, curr) => prev += curr, 0)
        }
        else
            maxValue = nums.filter(num => num != 0).reduce((prev, curr) => prev *= curr)
        return console.log(maxValue)
    } else if (minimum == 1) {
        const onesSum = nums.filter(num => num == 1).reduce((prev, curr) => prev += curr, 0);
        let othersMulti = nums.filter(num => num != 1);

        if (othersMulti.length) {
            othersMulti = othersMulti.reduce((prev, curr) => prev *= curr);
            maxValue = onesSum + othersMulti;
        }
        else {
            maxValue = onesSum;
        }

        return console.log(maxValue)
    } else {
        maxValue = nums.reduce((prev, curr) => prev *= curr);
        return console.log(maxValue)
    }

})

var dato1 =parseInt(readline());
var dato2=parseInt(readline());
var dato3=parseInt(readline());

var operacion1= dato3 * (dato1 + dato2);

var operacion2= dato1 * (dato2 + dato3);

var operacion3=(dato1+dato3)*dato2;

var resultado=0;

if(dato1>1 && dato2>1 && dato3>1){
    print(dato1*dato2*dato3);
}else if(dato1==1 && dato2==1 && dato3==1){
    print(dato1+dato2+dato3)
}
    else if(operacion1>operacion2 && operacion1>operacion3){
    print(operacion1);
    }
        else if(operacion2>operacion1 && operacion2>operacion3){
            print(operacion2);
        } else{print(operacion3);}

var n = readline();
var res = 0;
for (var i=0; i<n; i++){
	var n = readline();
	if (n==0||n==1)
 	res+=Number(n);
	else if (res==1)
	res+=Number(n);
     else res*=Number(n);
}
print(res);

var res =0;
for (var i=0; i<3; i++){
	var n = readline();
    if (n==1)
	res+=Number(n);
	else if (res==1)
		res+=Number(n);
	else  res*=Number(n);
}
print(res);

var res = 0;		          ////580A
for (var i=0; i<3; i++){
	var n = readline();
	n===0||n==1? res+=Number(n):res*=Number(n)
}
 print(res);

var a = Number(readline());
var b = Number(readline());
var c = Number(readline());
var res;
if (a != 1 && b != 1 && c!=1) {
    res = a*b*c;
}
else {
    if (a+b+c - Math.max(a, b, c) == 2) {
        res = a+b+c;
    }
    else if (a == 1) {
        res = (a+b)*c
    }
    else if (b == 1) {
        res = (Math.min(a, c) + 1) * Math.max(a, c);
    }
    else if (c == 1) {
        res  = a*(b+c);
    }
}

print(res);

//var inputs = readline().split(" ").map(function(x) { return parseInt(x); });
var iPreNum = readline().split(" ").map(function(x) { return parseInt(x); });
var iMidNum = readline().split(" ").map(function(x) { return parseInt(x); });
var iFrontNum = readline().split(" ").map(function(x) { return parseInt(x); });

var iSum = new Array();
iSum[0] = iPreNum + iMidNum + iFrontNum;
iSum[1] = (iPreNum + iMidNum) * iFrontNum;
iSum[2] = iPreNum * (iMidNum + iFrontNum);
iSum[3] = iPreNum * iMidNum * iFrontNum;

var iFinalAns = iSum[0];

for (var i = 1; i <= 3; i++) {
	if (iFinalAns < iSum[i])
		iFinalAns = iSum[i];
}

print(iFinalAns + "\n");

const readline = require('readline');

let inputs = [];

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

// Read Inputs
rl.on('line', lineInput => {
    inputs.push(lineInput)
})

rl.on('close', () => {

    const nums = inputs.map(num => parseInt(num));
    const minimum = Math.min(...nums);
    const maximum = Math.max(...nums);
    const othersValue = nums.filter(num => num != maximum).reduce((prev, curr) => prev += curr, 0)
    let maxValue = 0;

    // If first number == 0
    if (minimum == 0) {
        if (nums.includes(1)) {
            maxValue = nums.reduce((prev, curr) => prev += curr, 0)
        }
        else
            maxValue = nums.filter(num => num != 0).reduce((prev, curr) => prev *= curr)
        return console.log(maxValue)
    } else if (minimum == 1) {
        const onesSum = nums.filter(num => num == 1).reduce((prev, curr) => prev += curr, 0);
        let othersMulti = nums.filter(num => num != 1);

        if (othersMulti.length) {
            othersMulti = othersMulti.reduce((prev, curr) => prev *= curr);
            maxValue = onesSum + othersMulti;
        }
        else
            maxValue = onesSum;

        return console.log(maxValue)
    } else {
        maxValue = nums.reduce((prev, curr) => prev *= curr);
        return console.log(maxValue)
    }

})

'use strict';

(function() {
    let a = parseInt(readline()),
        b = parseInt(readline()),
        c = parseInt(readline());

    let array = [a,b,c];

    let str = array.join();
    str = str.split('1');

    if(3 - str.length >= 2) {
        write(a+b+c);
        return;
    }

    let indexOfOne = array.indexOf(1);

    if(indexOfOne === -1){
        write(a*b*c);
    } else if(indexOfOne === 0) {
      write((array[0] + array[1])*array[2]);
    } else if (indexOfOne === 2) {
      write((array[2] + array[1])*array[0]);
    } else {
        array.sort((a, b) => a - b);

        write((a[0] + a[1])*a[2]);
    }

    return;

})();

var a=readline(),b=readline(),c=readline()
if (a==b && b==c && c==1){
    print("3")
}else if (a==b && a==1){
    print((a+b)*c)
}else if (a==c && a==1){
    print((a+c)*b)
}else if (b==c && b==1){
    print((b+c)*a)
}
else if(a==1){
    print((a+Math.min(b,c))*Math.max(b,c))
}else if(b==1){
    print((b+Math.min(a,c))*Math.max(a,c))

}else if (c==1){
    print((c+Math.min(a,b))*Math.max(a,b))
}else{
    print(a*b*c)
}

var inp = [];
inp.push(parseInt(readline()));
inp.push(parseInt(readline()));
inp.push(parseInt(readline()));
var M = Math;
var sortF = function(a,b){return a > b;};

inp.sort(sortF);

var res = M.max(inp[0]*inp[1]*inp[2], inp[2]*(inp[0]+inp[1]), inp[0] + inp[1] + inp[2], inp[0] * (inp[2] + inp[1]));

print(res);

var res = 1;
var x =0;		          ////580A
for (var i=0; i<3; i++){
	var n = readline();
	n==0||n==1? x+=Number(n):res*=Number(n)
}
 print(res+x);

var a = parseInt(readline()),
b = parseInt(readline()),
c = parseInt(readline()),
firstExp = a + b * c,
secondExp = a * (b +c),
thirdExp = a * b * c,
fourthExp = (a + b) * c,
max = 0;
if(max < firstExp){
    max = firstExp;
}

if(max < secondExp){
    max = secondExp;
}

if(max < thirdExp){
    max = thirdExp;
}

if(max < fourthExp){
    max = fourthExp;
}

print(max);

	 var a = 0; var b = 0; var c =0;
	 for (var i=0; i<3; i++){
			if(i==0) a = +readline();
			else if (i==2) b = +readline();
			else c = +readline();
	 }
	 var arr = [];
	 arr[0] = a+b*c;
	 arr[1] = a*(b+c);
	 arr[2] = a*b*c;
	 arr[3] = (a+b)*c;
	print(Math.max.apply(this, arr));

var str = "";
for (var i=0; i<3; i++){
		str += readline();
}
str.split(" ");
var res = +str[0];

	if(+str[1]+res<+str[1]+Number(str[2])){
		res+= +str[1];
		res*= +str[2];
	}
	else {
	   res*=+str[1]+Number(str[2]);
	}
print(res);

var a = parseInt(readline());
var b = parseInt(readline());
var c = parseInt(readline());

var max = a;

if(a==0 || b==0 || a==1 || b==1){
    max = max + b;
    if(max==0 || c==0 || max==1 || c==1){
        max = max + c;
    } else {
        max = max * c;
    }
} else{
    max = max * b;
    if(max==0 || c==0 || max==1 || c==1){
        max = max + c
    } else {
        max = max * c;
    }
}

print(max);

//x=readline();
var a = [];
a.push(readline());
 a.push(readline());
 a.push(readline());
a = a.sort(function(a,b){
    return a-b;
});
var max_stack = [];
//(a+b)*c
max_stack.push(parseInt((parseInt(a[0])+parseInt(a[1]))*parseInt(a[2])));
//a*(b+c)
max_stack.push(parseInt(parseInt(a[0])*(parseInt(a[1])+parseInt(a[2]))));
//a*b*c
max_stack.push(parseInt(parseInt(a[0])*parseInt(a[1])*parseInt(a[2])));

//a*b+c

max_stack.push(parseInt(parseInt(a[0])*parseInt(a[1])+parseInt(a[2])));
//a+b*c
max_stack.push(parseInt(parseInt(a[0])+parseInt(a[1])*parseInt(a[2])));
//a+b+c
max_stack.push(parseInt(parseInt(a[0])+parseInt(a[1])+parseInt(a[2])));

var maximus=-999;
for(i=0;i<max_stack.length;i++)
{
  if(maximus<max_stack[i])
  {
      maximus=max_stack;
  }
}
max_stack=max_stack.sort(function(a,b){
    return b-a;
});
print((max_stack[0]));

//for(i=0;i<a.length;i++)
//print(a[0]);

/*var k = readline();
var c = readline();
var len = 0;
for(i=c.length-1,j=0;i>=0,j<k.length;i--,j++)
{
   if(k[i]==c[j]){
       len++;
   }
}
 if(len==c.length)
 {
     print('YES')
 }
 else
 print('NO')*/

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

var res = readline();
for (var i=0; i<3; i++){
	var n = readline();
	if (n==0||n==1)
 	res+=Number(n);
	else if (res==1)
	res+=Number(n);
     else res*=Number(n);
}
print(res);

var a =parseInt(readline()) ; var b = parseInt(readline()) ; var c = parseInt(readline()) ;
var max = [a,b,c].filter(x => x===1).length
var umax = Math.max(a,b,c);

if(max == 2){
	if((a == b)||(b==c)){print(umax*2)}else{print(a+b+c)}
}

if(max == 1){

	if(a == 1){print((1+b)*c);}
    if(c == 1){print((1+b)*a)}
    if(b == 1){
    	if(a>c){print((a+1)*c)}else{print((c+1)*b)}}

}

if(max == 3){print(3)}
if(max == 0){print(a*b*c)}

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

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

var res = 0;

  var one = Number(readline());
  res+=one; //5

  var two = Number(readline());
  var three = Number(readline());

  if (res==1)
	 res+= two;
	 else if(str==1) {
	 one>three? res*=three+two: res*=one+two;
	}
	res*=two;
	res *= three;
    print(res);

'use strict';

(function() {
    let a = parseInt(readline()),
        b = parseInt(readline()),
        c = parseInt(readline());

    if(a === 1 && b === 1 && c === 1) {
        write(3);
        return;
    }

    let array = [a,b,c];

    let indexOfOne = array.indexOf(1);

    if(indexOfOne === -1){
        write(a*b*c);
    } else if(indexOfOne === 0) {
      write((array[0] + array[1])*array[2]);
    } else if (indexOfOne === 2) {
      write((array[2] + array[1])*array[0]);
    } else {
        array.sort((a, b) => a - b);

        write((a[0] + a[1])*a[2]);
    }

    return;

})();

var a = Number(readline());
var b = Number(readline());
var c = Number(readline());
var res;
if (a != 1 && b != 1 && c!=1) {
    res = a*b*c;
}
else {
    if (a+b+c - Math.max(a, b, c) == 2) {
        res = a+b+c;
    }
    else if (a == 1) {
        res = (a+b)*c
    }
    else if (b == 1) {
        res = (Math.min(a, c) + 1) * Math.max(a, c);
    }
    else if (c == 1) {
        res  = a*(b+c);
    }
}

print(res);

var inp = [];
inp.push(parseInt(readline()));
inp.push(parseInt(readline()));
inp.push(parseInt(readline()));
var M = Math;
var sortF = function(a,b){return a > b;};

inp.sort(sortF);

var res = M.max(inp[0]*inp[1]*inp[2], inp[2]*(inp[0]+inp[1]), inp[0] + inp[1] + inp[2], inp[0] * (inp[2] + inp[1]));

print(res);

var res =0;
for (var i=0; i<3; i++){
	var n = readline();
    if (res==0);
	res+=Number(n);
	if (res==1)
		res+=Number(n);
	else res*=Number(n);
}
print(res);

var a = +readline();
var b = +readline();
var c = +readline();

var max = list = [
	a + ( b * c ),
	a * ( b + c ),
	a * b * c,
	a + b + c,
	( a + b ) * c,
].sort().reverse().pop();

print(max);

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

var str = readline().split(" ");
var res = +str[0];

	if(+str[1]+res<+str[1]+Number(str[2])){
		res+= +str[1];
		res*= +str[2];
	}
	else {
	   res*=+str[1]+Number(str[2]);
	}

print(res);

var inp = [];
inp.push(parseInt(readline()));
inp.push(parseInt(readline()));
inp.push(parseInt(readline()));
var M = Math;
var sortF = function(a,b){return a > b;};

inp.sort(sortF);

var res = M.max(inp[0]*inp[1]*inp[2], inp[2]*(inp[0]+inp[1]), inp[0] + inp[1] + inp[2], inp[0] * (inp[2] + inp[3]));

print(res);

var a=Number.parseInt(readline()),b=Number.parseInt(readline()),c=Number.parseInt(readline())
if (a===b && b===c && c===1){
    print("3")
}else if (a===b && a===1){
    print((a+b)*c)
}else if (a===c && a===1){
    print((a+c)*b)
}else if (b===c && b===1){
    print((b+c)*a)
}
else if(a===1){
    print((a+Math.min(b,c))*Math.max(b,c))
}else if(b===1){
    print((b+Math.min(a,c))*Math.max(a,c))

}else if (c===1){
    print((c+Math.min(a,b))*Math.max(a,b))
}else{
    print(a*b*c)
}

var inputs = readline().split(" ").map(function(x) { return parseInt(x); });
var n = inputs[0], m = inputs[1], a = inputs[2];

print(n + " " + m + " " + a);

	 var a = 0; var b = 0; var c =0;
	 for (var i=0; i<3; i++){
			if(i==0) a = +readline();
			else if (i==2) b = +readline();
			else c = +readline();
	 }
	 var arr = [];
	 arr[0] = a+b*c;
	 arr[1] = a*(b+c);
	 arr[2] = a*b*c;
	 arr[3] = (a+b)*c;
	print(Math.max.apply(this, arr));

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

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

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+=3) {
    doit(txt[i]*1, txt[i+1] * 1,txt[i+2]*1);

}

function doit(n1, n2,n3) {
    if(n1>n3){
        console.log(n1*(n2+n3));
    }else{
        console.log((n1+n2)*n3);
    }
}

//var inputs = readline().split(" ").map(function(x) { return parseInt(x); });
var iPreNum = Number(readline().split(" ").map(function(x) { return parseInt(x); }));
var iMidNum = Number(readline().split(" ").map(function(x) { return parseInt(x); }));
var iFrontNum = Number(readline().split(" ").map(function(x) { return parseInt(x); }));
print(typeof iPreNum);
var iSum = [];
iSum[0] = iPreNum + iMidNum + iFrontNum;
iSum[1] = (iPreNum + iMidNum) * iFrontNum;
iSum[2] = iPreNum * (iMidNum + iFrontNum);
iSum[3] = iPreNum * iMidNum * iFrontNum;

var iFinalAns = iSum[0];

for (var i = 1; i <= 3; i++) {
	if (iFinalAns < iSum[i])
		iFinalAns = iSum[i];
}

print(iFinalAns + "\n");

var a = readline() ; var b = readline() ; var c = readline() ;
var max = [a,b,c].filter(x => x===1).length
var umax = Math.max(a,b,c);

if(max == 2){
	if((a == b)||(b==c)){print(umax*2)}else{print(a+b+c)}
}

if(max == 1){

	if(a == 1){print((1+b)*c);}
    if(c == 1){print((1+b)*a)}
    if(b == 1){
    	if(a>c){print((a+1)*c)}else{print((c+1)*b)}}

}

if(max == 3){print(3)}
if(max == 0){print(a*b*c)}

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

var computeMax = function(arr)
    {
        var increase = function(a, b)
            {
                return a - b;
            }
        arr = arr.sort(increase);
        return (arr[0] + arr[1]) * arr[2];
    }
var arr = [];
for (var i = 1; i <= 3; i++)
    {
        var input = +readline();
        arr.push(input);
    }
print(computeMax(arr));

var res = 0;
var x =0;		          ////580A
for (var i=0; i<3; i++){
	var n = readline();
	n==0||n==1? x+=Number(n):res*=Number(n)
}
 print(res+x);

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

var inp = [];
inp.push(parseInt(readline()));
inp.push(parseInt(readline()));
inp.push(parseInt(readline()));
var M = Math;
var sortF = function(a,b){return a > b;};

inp.sort(sortF);

var res = M.max(inp[0]*inp[1]*inp[2], inp[2]*(inp[0]+inp[1]));

print(res);


Have you ever played Hanabi? If not, then you've got to try it out! This problem deals with a simplified version of the game.Overall, the game has 25 types of cards (5 distinct colors and 5 distinct values). Borya is holding n cards. The game is somewhat complicated by the fact that everybody sees Borya's cards except for Borya himself. Borya knows which cards he has but he knows nothing about the order they lie in. Note that Borya can have multiple identical cards (and for each of the 25 types of cards he knows exactly how many cards of this type he has).The aim of the other players is to achieve the state when Borya knows the color and number value of each of his cards. For that, other players can give him hints. The hints can be of two types: color hints and value hints. A color hint goes like that: a player names some color and points at all the cards of this color. Similarly goes the value hint. A player names some value and points at all the cards that contain the value.Determine what minimum number of hints the other players should make for Borya to be certain about each card's color and value.

The first line contains integer n (1 ≤ n ≤ 100) — the number of Borya's cards. The next line contains the descriptions of n cards. The description of each card consists of exactly two characters. The first character shows the color (overall this position can contain five distinct letters — R, G, B, Y, W). The second character shows the card's value (a digit from 1 to 5). Borya doesn't know exact order of the cards they lie in.

Print a single integer — the minimum number of hints that the other players should make.

NoteIn the first sample Borya already knows for each card that it is a green three.In the second sample we can show all fours and all red cards.In the third sample you need to make hints about any four colors.

var main = function () {
    var n = parseInt(readline());
    var cards = readline().split(/\s+/);
    var actions = [];
    cards = cards.filter(function (value, index, self) {
        return self.indexOf(value) == index;
    });

    if (cards.length <= 1) {
        print(0);
        return;
    }

    cards.forEach(function (card) {
        actions.push({type: 0, value: card[0]});

        actions.push({type: 1, value: card[1]});
    });

    actions.sort(function (a, b) {
        return (a.type === b.type) ? a.value.localeCompare(b.value) : (a.type - b.type);
    });
    actions = actions.filter(function (value, index, self) {
        return index === 0 ||
            self[index - 1].type !== value.type ||
            self[index - 1].value !== value.value;
    });

    var vars = [], ca = [];
    cards.forEach(function (value) {
        vars.push(cards.slice());
        ca.push(value);
    });

    var ans = actions.length;
    var cur = 0;
    var brute = function brute(idx) {
        if (idx >= actions.length)
            return;
        if (cur + 1 >= ans)
            return;

        cur++;

        var type = actions[idx].type;
        var value = actions[idx].value;

        var history = [];
        var good = true;
        for (var i = 0; i < ca.length; ++i) {
            if (vars[i].length > 1) {
                var oldHistory = history.length;
                vars[i].forEach(function (card) {
                    if ((ca[i][type] === value) !== (card[type] === value))
                        history.push([i, card]);
                });

                for (var j = oldHistory; j < history.length; ++j) {
                    vars[i].splice(vars[i].indexOf(history[j][1]), 1);
                }

                if (vars[i].length > 1) {
                    good = false;
                }
            }
        }

        /*
        print(vars[0]);
        print(vars[1]);
        print(vars[2]);
        print(cur);
        print(good);
        */

        if (good) {
            ans = Math.min(ans, cur);
        } else {
            brute(idx + 1);
        }

        for (var j = 0; j < history.length; ++j) {
            vars[history[j][0]].push(history[j][1]);
        }

        cur--;

        if (!good) {
            brute(idx + 1);
        }
    }

    brute(0);

    print(ans);
};

main();

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

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

function main() {
	var n = parseInt(readline()), cards = tokenize(readline()),
		colors = ['R', 'G', 'B', 'Y', 'W'], ranks = ['1', '2', '3', '4', '5'],
		suits = {};
	for (var i = 0; i < 5; ++i) {
		var color = colors[i], rank = ranks[i];
		suits[color] = [];
		suits[rank] = [];
		for (var j = 0; j < 5; ++j) {
			suits[color].push(color+ranks[j]);
			suits[rank].push(colors[j]+rank);
		}
	}
	function makeSet() {
		var set = { hash: {}, count: 0 };
		set.add = function (x) {
			if (!set.hash[x]) {
				set.hash[x] = true;
				++set.count;
			}
		};
		set.remove = function (x) {
			if (set.hash[x]) {
				set.hash[x] = false;
				--set.count;
			}
		};
		return set;
	}
	function removeSuit(set, suit) {
		for (var i = 0; i < 5; ++i) {
			set.remove(suit[i]);
		}
	}
	var best = 10;
	for (var mask = 0; mask < 1024; ++mask) {
		var hints = [];
		for (var i = 0; i < 10; ++i) {
			if ((mask & (1 << i)) != 0) {
				hints.push(i < 5 ? colors[i] : ranks[i-5]);
			}
		}
		//print(hints.join(' '));
		for (var i = 0; i < n; ++i) {
			var color = cards[i].charAt(0), rank = cards[i].charAt(1),
				set = makeSet();
			for (var j = 0; j < n; ++j) {
				set.add(cards[j]);
			}
			for (var j = 0; j < hints.length; ++j) {
				var hint = hints[j],
					attribute = hint.match(/\d/) ? rank : color;
				//print('hint = '+hint+', attribute = '+attribute);
				if (hint != attribute) {
					removeSuit(set, suits[hint]);
				} else {
					var attributes = hint.match(/\d/) ? ranks : colors;
					for (var k = 0; k < 5; ++k) {
						if (attributes[k] != hint) {
							removeSuit(set, suits[attributes[k]]);
						}
					}
				}
			}
			if (set.count != 1) {
				break;
			}
		}
		if (i == n) {
			best = Math.min(best, hints.length);
		}
	}
	print(best);
}

main();

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

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

function main() {
	var n = parseInt(readline()), cards = tokenize(readline()),
		colors = ['R', 'G', 'B', 'Y', 'W'], ranks = ['1', '2', '3', '4', '5'],
		suits = {}, hash = {}, unique = [];
	for (var i = 0; i < n; ++i) {
		if (hash[cards[i]] === undefined) {
			hash[cards[i]] = true;
			unique.push(cards[i]);
		}
	}
	cards = unique;
	n = cards.length;
	for (var i = 0; i < 5; ++i) {
		var color = colors[i], rank = ranks[i];
		suits[color] = [];
		suits[rank] = [];
		for (var j = 0; j < 5; ++j) {
			suits[color].push(color+ranks[j]);
			suits[rank].push(colors[j]+rank);
		}
	}
	function makeSet() {
		var set = { hash: {}, count: 0 };
		set.add = function (x) {
			if (!set.hash[x]) {
				set.hash[x] = true;
				++set.count;
			}
		};
		set.remove = function (x) {
			if (set.hash[x]) {
				set.hash[x] = false;
				--set.count;
			}
		};
		return set;
	}
	function removeSuit(set, suit) {
		for (var i = 0; i < 5; ++i) {
			set.remove(suit[i]);
		}
	}
	var best = 10;
	for (var mask = 0; mask < 1024; ++mask) {
		var hints = [];
		for (var i = 0; i < 10; ++i) {
			if ((mask & (1 << i)) != 0) {
				hints.push(i < 5 ? colors[i] : ranks[i-5]);
			}
		}
		for (var i = 0; i < n; ++i) {
			var color = cards[i].charAt(0), rank = cards[i].charAt(1),
				set = makeSet();
			for (var j = 0; j < n; ++j) {
				set.add(cards[j]);
			}
			for (var j = 0; j < hints.length; ++j) {
				var hint = hints[j],
					attribute = hint.match(/\d/) ? rank : color;
				if (hint != attribute) {
					removeSuit(set, suits[hint]);
				} else {
					var attributes = hint.match(/\d/) ? ranks : colors;
					for (var k = 0; k < 5; ++k) {
						if (attributes[k] != hint) {
							removeSuit(set, suits[attributes[k]]);
						}
					}
				}
			}
			if (set.count != 1) {
				break;
			}
		}
		if (i == n) {
			best = Math.min(best, hints.length);
		}
	}
	print(best);
}

main();

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

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

function main() {
	var n = parseInt(readline()), cards = tokenize(readline()),
		colors = ['R', 'G', 'B', 'Y', 'W'], ranks = ['1', '2', '3', '4', '5'],
		maybe = new Array(n), color2cards = {}, rank2cards = {};
	var unique = [], hash = {};
	for (var i = 0; i < n; ++i) {
		if (hash[cards[i]] === undefined) {
			unique.push(cards[i]);
			hash[cards[i]] = true;
		}
	}
	cards = unique;
	n = cards.length;
	for (var i = 0; i < 5; ++i) {
		var color = colors[i], rank = ranks[i];
		color2cards[color] = [];
		rank2cards[rank] = [];
		for (var j = 0; j < 5; ++j) {
			color2cards[color].push(color+ranks[j]);
			rank2cards[rank].push(colors[j]+rank);
		}
	}
	function makeSet() {
		var set = { hash: {}, count: 0 };
		set.add = function (x) {
			if (!set.hash[x]) {
				set.hash[x] = true;
				++set.count;
			}
		};
		set.remove = function (x) {
			if (set.hash[x]) {
				set.hash[x] = false;
				--set.count;
			}
		};
		return set;
	}
	var best = 10, removed = new Array(n);
	for (var mask = 0; mask < 1024; ++mask) {
		for (var i = 0; i < n; ++i) {
			var set = maybe[i] = makeSet();
			for (var j = 0; j < n; ++j) {
				set.add(cards[j]);
			}
			removed[i] = {};
		}
		var hints = 0;
		for (var i = 0; i < 10; ++i) {
			if ((mask & (1 << i)) != 0) {
				++hints;
			}
		}
		if (hints > best) {
			continue;
		}
		for (var colorIx = 0; colorIx < 5; ++colorIx) {
			if ((mask & (1 << colorIx)) == 0) {
				continue;
			}
			var color = colors[colorIx];
			for (var i = 0; i < n; ++i) {
				if (maybe[i].count == 1) {
					continue;
				}
				if (cards[i].charAt(0) != color) {
					if (removed[i][colors]) {
						continue;
					}
					removed[i][color] = true;
					var suit = color2cards[color];
					for (var j = 0; j < 5; ++j) {
						maybe[i].remove(suit[j]);
					}
				} else {
					for (var j = 0; j < 5; ++j) {
						if (colors[j] != color) {
							if (removed[i][colors[j]]) {
								continue;
							}
							removed[i][colors[j]] = true;
							var suit = color2cards[colors[j]];
							for (var k = 0; k < 5; ++k) {
								maybe[i].remove(suit[k]);
							}
						}
					}
				}
			}
		}
		for (var rankIx = 5; rankIx < 10; ++rankIx) {
			if ((mask & (1 << rankIx)) == 0) {
				continue;
			}
			var rank = ranks[rankIx-5];
			for (var i = 0; i < n; ++i) {
				if (maybe[i].count == 1) {
					continue;
				}
				if (cards[i].charAt(1) != rank) {
					if (removed[i][rank]) {
						continue;
					}
					removed[i][rank] = true;
					var suit = rank2cards[rank];
					for (var j = 0; j < 5; ++j) {
						maybe[i].remove(suit[j]);
					}
				} else {
					for (var j = 0; j < 5; ++j) {
						if (ranks[j] != rank) {
							if (removed[i][ranks[j]]) {
								continue;
							}
							removed[i][ranks[j]] = true;
							var suit = rank2cards[ranks[j]];
							for (var k = 0; k < 5; ++k) {
								maybe[i].remove(suit[k]);
							}
						}
					}
				}
			}
		}
		var okay = true;
		for (var i = 0; i < n; ++i) {
			var set = maybe[i];
			if (set.count != 1) {
				okay = false;
				break;
			}
		}
		if (okay) {
			best = Math.min(best, hints);
		}
	}
	print(best);
}

main();


Not so long ago as a result of combat operations the main Berland place of interest — the magic clock — was damaged. The cannon's balls made several holes in the clock, that's why the residents are concerned about the repair. The magic clock can be represented as an infinite Cartesian plane, where the origin corresponds to the clock center. The clock was painted two colors as is shown in the picture:  The picture shows only the central part of the clock. This coloring naturally extends to infinity.The balls can be taken to be points on the plane. Your task is to find the color of the area, damaged by the given ball.All the points located on the border of one of the areas have to be considered painted black.

The first and single line contains two integers x and y — the coordinates of the hole made in the clock by the ball. Each of the numbers x and y has an absolute value that does not exceed 1000.

Find the required color. All the points between which and the origin of coordinates the distance is integral-value are painted black.

'use strict'

let lll = readline().split(' ').map(v => parseInt(v))
let X = lll[0]
let Y = lll[1]

let r = Math.sqrt(X * X + Y * Y)

let r0 = r | 0
let even = !(r0 % 2)
let q
if (X > 0 && Y > 0) {q = 1}
if (X > 0 && Y < 0) {q = 2}
if (X < 0 && Y < 0) {q = 1}
if (X < 0 && Y > 0) {q = 2}

;(function () {
  if (r == r0 || X == 0 || Y == 0) return print('black')
  if (q == 1 && even || q == 2 && !even) return print('black')
  if (q == 1 && !even || q == 2 && even) return print('white')
})()