Alexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know English letters, so he writes any number only as a decimal number, it means that instead of the letter A he will write the number 10. Thus, by converting the number 475 from decimal to hexadecimal system, he gets 11311 (475 = 1·162 + 13·161 + 11·160). Alexander lived calmly until he tried to convert the number back to the decimal number system.Alexander remembers that he worked with little numbers so he asks to find the minimum decimal number so that by converting it to the system with the base n he will get the number k.

The first line contains the integer n (2 ≤ n ≤ 109). The second line contains the integer k (0 ≤ k < 1060), it is guaranteed that the number k contains no more than 60 symbols. All digits in the second line are strictly less than n. Alexander guarantees that the answer exists and does not exceed 1018. The number k doesn't contain leading zeros.

Print the number x (0 ≤ x ≤ 1018) — the answer to the problem.

NoteIn the first example 12 could be obtained by converting two numbers to the system with base 13: 12 = 12·130 or 15 = 1·131 + 2·130.

//spnauti-rusT {{{
use std::io::*; use std::str::{self,*}; use std::fmt::Debug;
#[allow(unused_imports)] use std::cmp::Ordering::{self,*};
#[allow(unused_imports)] use std::ops::{self,*};
#[allow(unused_imports)] use std::iter::{self,*};
#[allow(unused_imports)] use std::collections::*;
#[allow(unused_imports)] use std::cell::*;
#[allow(unused_macros)] macro_rules! min {
	($x:expr,$y:expr) => {{ let b=$y; let a=&mut$x; if b < *a {*a=b; true} else {false} }};
}
#[allow(unused_macros)] macro_rules! max {
	($x:expr,$y:expr) => {{ let b=$y; let a=&mut$x; if b > *a {*a=b; true} else {false} }};
}
#[allow(unused_macros)] macro_rules! l {
	($($v:ident),+ =$e:expr) => {$(let$v=$e;)+};
	($($v:ident),+:$t:ty=$e:expr) => {$(let$v:$t=$e;)+};
	(mut $($v:ident),+ =$e:expr) => {$(let mut$v=$e;)+};
	(mut $($v:ident),+:$t:ty=$e:expr) => {$(let mut$v:$t=$e;)+};
}
#[allow(unused_macros)] macro_rules! v {
	([$d:expr]$($s:tt)+) => {vec![v!($($s)+);$d]};
	([]) => {Vec::new()}; ([$e:expr]) => {Vec::with_capacity($e)}; (=$e:expr) => {$e};
}
#[allow(unused_macros)] macro_rules! rep { {[$c:expr]$($s:tt)+} => {for _ in 0..$c {$($s)+}} }
#[allow(dead_code)] fn reader() -> WordReaderC { WordReaderC::new() }
#[allow(dead_code)] fn writer() -> BufWriter<Stdout> { BufWriter::new(stdout()) }
struct WordReaderC {buf: Vec<u8>, pos: usize, q: std::io::StdinLock<'static>}//'
#[allow(dead_code)] impl WordReaderC {
	fn new() -> Self {
		let r = unsafe {&*Box::into_raw(Box::new(stdin()))};
		Self { q: r.lock(), buf: v!([]), pos: 0 }
	}
	fn next_line(&mut self) -> bool {
		self.buf.clear(); self.pos = 0;
		self.q.read_until(b'\n', &mut self.buf).unwrap_or(0) > 0
	}
	fn is_ws(c: u8) -> bool {
		c == b' ' || c == b'\r' || c == b'\n' || c == b'\t'
	}
	fn byte(&mut self) -> Option<u8> {
		if self.pos == self.buf.len() { if !self.next_line() { return None; } }
		self.pos += 1; Some(self.buf[self.pos - 1])
	}
	fn vb(&mut self) -> Vec<u8> {
		let mut s = v!([8]);
		let mut f = false;
		loop {
			if let Some(c) = self.byte() {
				if !Self::is_ws(c) {
					s.push(c);
					f = true;
				} else if f { break; }
			} else { break; }
		}
		s
	}
	fn board(&mut self, r: usize, c: Option<usize>) -> Vec<Vec<u8>> {
		let mut res = v!([r]);
		let c = c.unwrap_or(0);
		rep!{[r]
			let t = self.vb();
			assert!(c == 0 || t.len() == c);
			res.push(t);
		}
		res
	}
	fn framed_board(&mut self, r: usize, c: usize, f: u8) -> Vec<Vec<u8>> {
		let mut res = v!([r+2]);
		res.push( v!([c+2] = f) );
		rep!{[r]
			let mut t = self.vb();
			assert!(t.len() == c);
			t.reserve(2);
			t.insert(0,f);
			t.push(f);
			res.push(t);
		}
		res.push( v!([c+2] = f) );
		res
	}
	fn s(&mut self) -> String { String::from_utf8(self.vb()).expect("invalid utf8") }
	fn i(&mut self) ->    i32 { self.p() }
	fn l(&mut self) ->    i64 { self.p() }
	fn u(&mut self) ->  usize { self.p() }
	fn f(&mut self) ->    f64 { self.p() }
	fn vi(&mut self, n: usize) -> Vec<i32> { self.vp(n) }
	fn vl(&mut self, n: usize) -> Vec<i64> { self.vp(n) }
	fn vu(&mut self, n: usize) -> Vec<usize> { self.vp(n) }
	fn ii(&mut self, n: usize) -> impl Iterator<Item=i32> { self.ip(n).into_iter() }
	fn iu(&mut self, n: usize) -> impl Iterator<Item=usize> { self.ip(n).into_iter() }
	fn p<T: FromStr>(&mut self) -> T where T::Err: Debug {
		let w = self.vb(); str::from_utf8(w.as_ref()).unwrap().parse::<T>().unwrap()
	}
	fn vp<T: FromStr>(&mut self, n: usize) -> Vec<T> where T::Err: Debug {
		(0..n).map(|_|self.p()).collect()
	}
	fn ip<T: FromStr>(&mut self, n: usize) -> impl Iterator<Item=T> where T::Err: Debug {
		self.vp(n).into_iter()
	}
	fn graph(&mut self, n: usize, m: usize) -> Vec<Vec<usize>> {
		let mut e = v!([n][]); rep!{[m] l!(a,b = self.u()-1); e[a].push(b); e[b].push(a); } e
	}
	fn graph_w<T: Copy+FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<(usize,T)>> where T::Err: Debug {
		let mut e = v!([n][]); rep!{[m] l!(a,b = self.u()-1); let c: T = self.p(); e[a].push((b,c)); e[b].push((a,c)); } e
	}
}
//------------------- End rusT }}}

fn main() {
	let mut rin = reader();
	let mut rout = writer();

	let b = rin.l();
	let s = rin.vb();
	let n = s.len();
	let mut dp = v!([n+1] = std::i64::MAX);
	dp[0] = 0;
	for i in 0..n {
		let mut x = 0;
		for j in i..n {
			x = x * 10 + (s[j] - b'0') as i64;
			if (s[i] == b'0' && j > i) || x >= b {
				break;
			}
			min!(dp[j+1], dp[i].saturating_mul(b).saturating_add(x));
		}
	}
	writeln!(rout, "{}", dp[n]).ok();
}

macro_rules! parse_line {
    ($t: ty) => ({
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        let a_str = a_str.trim();
        a_str.parse::<$t>().expect("parse error")
    });
    ($($t: ty),+) => ({
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        let mut a_iter = a_str.split_whitespace();
        (
            $(
            a_iter.next().unwrap().parse::<$t>().expect("parse error"),
            )+
        )
    })
}

macro_rules! parse_line_to_vec {
    ($t: ty) => {{
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        (a_str
            .split_whitespace()
            .map(|x| x.parse::<$t>().unwrap())
            .collect::<Vec<$t>>())
    }};
}

fn solve() {
    let n = parse_line!(u64);
    let s: Vec<_> = parse_line!(String).bytes().map(|c| (c - b'0') as u64).collect();
    let l = s.len();
    let mut dp = vec![std::u64::MAX; l + 1];
    dp[0] = 0;
    let mut digits = vec![0; l + 1];
    for (i, &c) in s.iter().enumerate() {
        for j in (1..=i + 1).rev() {
            digits[j] = digits[j - 1] * 10 + c;
        }
        for j in 0..=i {
            if digits[j + 1] >= n {
                break;
            }
            if j > 0 && s[i - j] == 0 {
                continue;
            }
            dp[i + 1] = std::cmp::min(dp[i + 1], dp[i - j] * n + digits[j + 1]);
        }
    }
    println!("{}", dp[l]);
}

fn main() {
    let tests = 1; // parse_line!(usize);
    for _ in 0..tests {
        solve();
    }
}

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::*;
#[allow(dead_code)]
fn getline() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    return ret;
}
fn get_word() -> String {
    let mut stdin = std::io::stdin();
    let mut u8b: [u8; 1] = [0];
    loop {
        let mut buf: Vec<u8> = Vec::with_capacity(16);
        loop {
            let res = stdin.read(&mut u8b);
            if res.is_err() || res.ok().unwrap() == 0 || u8b[0] <= ' ' as u8 {
                break;
            } else {
                buf.push(u8b[0]);
            }
        }
        if buf.len() >= 1 {
            let ret = std::string::String::from_utf8(buf).unwrap();
            return ret;
        }
    }
}
fn parse<T: std::str::FromStr>(s: &str) -> T { s.parse::<T>().ok().unwrap() }

#[allow(dead_code)]
fn get<T: std::str::FromStr>() -> T { parse(&get_word()) }

fn numero(v: &[i64], b: i64) -> Option<i64> {
    let mut cur: i64 = 0;
    for &t in v.iter() {
        cur = match cur.checked_mul(b) {
            Some(v) => v,
            None => return None,
        };
        cur = match cur.checked_add(t) {
            Some(v) => v,
            None => return None,
        }
    }
    Some(cur)
}

fn checked_propagate(b: i64, x: i64, y: i64) -> Option<i64> {
    let cur = match x.checked_mul(b) {
        Some(v) => v,
        None => return None,
    };
    cur.checked_add(y)
}

fn main() {
    let b: i64 = get();
    let s: Vec<_> = get_word().bytes().map(|b| b as i64 - 0x30).collect();
    let n = s.len();
    if b <= 9 {
        // simply read b-base rep.
        let mut cur = 0;
        for v in s {
            cur *= b;
            cur += v;
        }
        println!("{}", cur);
        return;
    }
    let mut dp = vec![-1i64; n + 1];
    const INF: i64 = 1i64 << 60;
    dp[0] = 0;
    for i in 1 .. n + 1 {
        let mut mi = INF;
        for j in 1 .. i + 1 {
            // s[i - j ..i] < b ?
            if j >= 10 || dp[i - j] < 0 || (j >= 2 && s[i - j] == 0) {
                continue;
            }
            let sl = numero(&s[i - j .. i], 10);
            match sl {
                Some(v) if v < b => match checked_propagate(b, dp[i - j], v) {
                    Some(v) => { mi = min(mi, v) },
                    None => {},
                },
                _ => {},
            }
        }
        if mi < INF {
            dp[i] = mi;
        }
    }
    //println!("{:?}", dp);
    println!("{}", dp[n]);
}

//spnauti-rusT {{{
use std::io::*; use std::str::{self,*}; use std::fmt::Debug;
#[allow(unused_imports)] use std::cmp::Ordering::{self,*};
#[allow(unused_imports)] use std::ops::{self,*};
#[allow(unused_imports)] use std::iter::{self,*};
#[allow(unused_imports)] use std::collections::*;
#[allow(unused_imports)] use std::cell::*;
#[allow(unused_macros)] macro_rules! min {
	($x:expr,$y:expr) => {{ let b=$y; let a=&mut$x; if b < *a {*a=b; true} else {false} }};
}
#[allow(unused_macros)] macro_rules! max {
	($x:expr,$y:expr) => {{ let b=$y; let a=&mut$x; if b > *a {*a=b; true} else {false} }};
}
#[allow(unused_macros)] macro_rules! l {
	($($v:ident),+ =$e:expr) => {$(let$v=$e;)+};
	($($v:ident),+:$t:ty=$e:expr) => {$(let$v:$t=$e;)+};
	(mut $($v:ident),+ =$e:expr) => {$(let mut$v=$e;)+};
	(mut $($v:ident),+:$t:ty=$e:expr) => {$(let mut$v:$t=$e;)+};
}
#[allow(unused_macros)] macro_rules! v {
	([$d:expr]$($s:tt)+) => {vec![v!($($s)+);$d]};
	([]) => {Vec::new()}; ([$e:expr]) => {Vec::with_capacity($e)}; (=$e:expr) => {$e};
}
#[allow(unused_macros)] macro_rules! rep { {[$c:expr]$($s:tt)+} => {for _ in 0..$c {$($s)+}} }
#[allow(dead_code)] fn reader() -> WordReaderC { WordReaderC::new() }
#[allow(dead_code)] fn writer() -> BufWriter<Stdout> { BufWriter::new(stdout()) }
struct WordReaderC {buf: Vec<u8>, pos: usize, q: std::io::StdinLock<'static>}//'
#[allow(dead_code)] impl WordReaderC {
	fn new() -> Self {
		let r = unsafe {&*Box::into_raw(Box::new(stdin()))};
		Self { q: r.lock(), buf: v!([]), pos: 0 }
	}
	fn next_line(&mut self) -> bool {
		self.buf.clear(); self.pos = 0;
		self.q.read_until(b'\n', &mut self.buf).unwrap_or(0) > 0
	}
	fn is_ws(c: u8) -> bool {
		c == b' ' || c == b'\r' || c == b'\n' || c == b'\t'
	}
	fn byte(&mut self) -> Option<u8> {
		if self.pos == self.buf.len() { if !self.next_line() { return None; } }
		self.pos += 1; Some(self.buf[self.pos - 1])
	}
	fn vb(&mut self) -> Vec<u8> {
		let mut s = v!([8]);
		let mut f = false;
		loop {
			if let Some(c) = self.byte() {
				if !Self::is_ws(c) {
					s.push(c);
					f = true;
				} else if f { break; }
			} else { break; }
		}
		s
	}
	fn board(&mut self, r: usize, c: Option<usize>) -> Vec<Vec<u8>> {
		let mut res = v!([r]);
		let c = c.unwrap_or(0);
		rep!{[r]
			let t = self.vb();
			assert!(c == 0 || t.len() == c);
			res.push(t);
		}
		res
	}
	fn framed_board(&mut self, r: usize, c: usize, f: u8) -> Vec<Vec<u8>> {
		let mut res = v!([r+2]);
		res.push( v!([c+2] = f) );
		rep!{[r]
			let mut t = self.vb();
			assert!(t.len() == c);
			t.reserve(2);
			t.insert(0,f);
			t.push(f);
			res.push(t);
		}
		res.push( v!([c+2] = f) );
		res
	}
	fn s(&mut self) -> String { String::from_utf8(self.vb()).expect("invalid utf8") }
	fn i(&mut self) ->    i32 { self.p() }
	fn l(&mut self) ->    i64 { self.p() }
	fn u(&mut self) ->  usize { self.p() }
	fn f(&mut self) ->    f64 { self.p() }
	fn vi(&mut self, n: usize) -> Vec<i32> { self.vp(n) }
	fn vl(&mut self, n: usize) -> Vec<i64> { self.vp(n) }
	fn vu(&mut self, n: usize) -> Vec<usize> { self.vp(n) }
	fn ii(&mut self, n: usize) -> impl Iterator<Item=i32> { self.ip(n).into_iter() }
	fn iu(&mut self, n: usize) -> impl Iterator<Item=usize> { self.ip(n).into_iter() }
	fn p<T: FromStr>(&mut self) -> T where T::Err: Debug {
		let w = self.vb(); str::from_utf8(w.as_ref()).unwrap().parse::<T>().unwrap()
	}
	fn vp<T: FromStr>(&mut self, n: usize) -> Vec<T> where T::Err: Debug {
		(0..n).map(|_|self.p()).collect()
	}
	fn ip<T: FromStr>(&mut self, n: usize) -> impl Iterator<Item=T> where T::Err: Debug {
		self.vp(n).into_iter()
	}
	fn graph(&mut self, n: usize, m: usize) -> Vec<Vec<usize>> {
		let mut e = v!([n][]); rep!{[m] l!(a,b = self.u()-1); e[a].push(b); e[b].push(a); } e
	}
	fn graph_w<T: Copy+FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<(usize,T)>> where T::Err: Debug {
		let mut e = v!([n][]); rep!{[m] l!(a,b = self.u()-1); let c: T = self.p(); e[a].push((b,c)); e[b].push((a,c)); } e
	}
}
//------------------- End rusT }}}

fn main() {
	let mut rin = reader();
	let mut rout = writer();

	let b = rin.l();
	let s = rin.vb();
	let n = s.len();
	let mut dp = v!([n+1] = std::i64::MAX);
	dp[0] = 0;
	for i in 0..n {
		let mut x = 0;
		for j in i..n {
			x = x * 10 + (s[j] - b'0') as i64;
			if (s[i] == b'0' && j > i) || x >= b {
				break;
			}
			min!(dp[j+1], dp[i] * b + x);
		}
	}
	writeln!(rout, "{}", dp[n]).ok();
}

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::*;
#[allow(dead_code)]
fn getline() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    return ret;
}
fn get_word() -> String {
    let mut stdin = std::io::stdin();
    let mut u8b: [u8; 1] = [0];
    loop {
        let mut buf: Vec<u8> = Vec::with_capacity(16);
        loop {
            let res = stdin.read(&mut u8b);
            if res.is_err() || res.ok().unwrap() == 0 || u8b[0] <= ' ' as u8 {
                break;
            } else {
                buf.push(u8b[0]);
            }
        }
        if buf.len() >= 1 {
            let ret = std::string::String::from_utf8(buf).unwrap();
            return ret;
        }
    }
}
fn parse<T: std::str::FromStr>(s: &str) -> T { s.parse::<T>().ok().unwrap() }

#[allow(dead_code)]
fn get<T: std::str::FromStr>() -> T { parse(&get_word()) }

fn numero(v: &[i64], b: i64) -> i64 {
    let mut cur = 0;
    for &t in v.iter() {
        cur *= b;
        cur += t;
    }
    cur
}

fn main() {
    let b: i64 = get();
    let s: Vec<_> = get_word().bytes().map(|b| b as i64 - 0x30).collect();
    let n = s.len();
    if b <= 9 {
        // simply read b-base rep.
        let mut cur = 0;
        for v in s {
            cur *= b;
            cur += v;
        }
        println!("{}", cur);
        return;
    }
    let mut dp = vec![-1i64; n + 1];
    const INF: i64 = 1i64 << 60;
    dp[0] = 0;
    for i in 1 .. n + 1 {
        let mut mi = INF;
        for j in 1 .. i + 1 {
            // s[i - j ..i] < b ?
            if j >= 10 || dp[i - j] < 0 || (j >= 2 && s[i - j] == 0) ||
                numero(&s[i - j .. i], 10) >= b {
                continue;
            }
            mi = min(mi, b * dp[i - j] + numero(&s[i - j .. i], 10));
        }
        if mi < INF {
            dp[i] = mi;
        }
    }
    println!("{}", dp[n]);
}


You are a lover of bacteria. You want to raise some bacteria in a box. Initially, the box is empty. Each morning, you can put any number of bacteria into the box. And each night, every bacterium in the box will split into two bacteria. You hope to see exactly x bacteria in the box at some moment. What is the minimum number of bacteria you need to put into the box across those days?

The only line containing one integer x (1 ≤ x ≤ 109).

The only line containing one integer: the answer.

NoteFor the first sample, we can add one bacterium in the box in the first day morning and at the third morning there will be 4 bacteria in the box. Now we put one more resulting 5 in the box. We added 2 bacteria in the process so the answer is 2.For the second sample, we can put one in the first morning and in the 4-th morning there will be 8 in the box. So the answer is 1.

fn count(n: u32) -> u32 {
    if n == 1 {
        return 1;
    }

    if n % 2 == 1 {
        1 + count(n / 2)
    } else {
        count(n / 2)
    }
}

fn main() {
    let n = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        buf.trim().parse().unwrap()
    };

    println!("{}", count(n));
}

//spnauti-rust
#[allow(unused_macros)]
macro_rules! a {
    ($c: tt, $x: expr, $y: expr) => {{
        let b = $y; let a = &mut $x;
        if b $c *a { *a = b; true } else { false }
    }};
}
struct WordReader {
    it : std::vec::IntoIter<String>,
}
#[allow(dead_code)]
impl WordReader {
    fn new<T: std::io::Read>(mut reader: T) -> WordReader {
        let mut s = String::new();
        reader.read_to_string(&mut s).unwrap();
        WordReader {
            it : s.split_ascii_whitespace().map(String::from)
            .collect::<Vec<_>>().into_iter()
        }
    }
    fn from_stdin() -> WordReader {
        WordReader::new(std::io::stdin())
    }
    fn s(&mut self) -> String {
        self.it.next().unwrap()
    }
    fn ab(&mut self) -> Vec<u8> {
        self.it.next().unwrap().into_bytes()
    }
    fn i(&mut self) -> i32 {
        self.it.next().unwrap().parse().unwrap()
    }
    fn ai(&mut self, n: usize) -> Vec<i32> {
        let mut a = Vec::with_capacity(n);
        for _ in 0..n { a.push(self.i()); }
        a
    }
}

fn main() {
    let mut input = WordReader::from_stdin();
    let mut n = input.i();
    let mut sol = 0;
    while n > 0 {
        sol += 1;
        n -= n & -n;
    }
    println!("{}", sol);
}

#[allow(unused_imports)]
use std::cmp::{max,min};

macro_rules! readln {
    () => {{
        use std::io;

        let mut buf = String::new();
        io::stdin().read_line(&mut buf).unwrap();
        buf.trim().to_string()
    }};
    ( $t:ty ) => {{
        let input = readln!();
        input.parse::<$t>().unwrap()
    }};
    ( $( $t:ty ),+ ) => {{
        let input = readln!();
        let mut input = input.split_whitespace();
        (
            $(
                input.next().unwrap().parse::<$t>().unwrap(),
            )+
        )
    }}
}

macro_rules! readvec {
    ( $t:ty ) => {{
        let input = readln!();
        let mut input = input.split_whitespace();
        let mut result = Vec::new();
        for elem in input {
            result.push(elem.parse::<$t>().unwrap());
        }
        result
    }}
}

fn solve(x:i32) -> i32 {
    if x==0 {
        return 0;
    } else if (x%2) == 0 {
        return solve(x/2);
    } else if (x%2) == 1 {
        return 1+solve(x/2);
    }
    return -1;
}

fn main() {
    let n = readln!(i32);
    println!("{}",solve(n));
}

use std::io::stdin;

fn main() {
	let mut n = String::new();
	stdin().read_line(&mut n).unwrap();
	let n: i64 = n.trim().parse().unwrap();

	let mut ans: i8 = 0;
	for bit in 0..64 {
		if n & 1<<bit > 0 {
			ans += 1;
		}
	}
	println!("{}", ans);
}

// {{{ by shik

use std::io;

#[allow(dead_code)]
fn gets() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(unused_macros)]
macro_rules! R {
    ( $ty:ty, ... ) => {
        gets().split_whitespace().map(|x| x.parse::<$ty>().unwrap()).collect::<Vec<_>>()
    };
    ( $($ty:ty),* ) => {{
        let line = gets();
        let mut it = line.split_whitespace();
        ( $(it.next().unwrap().parse::<$ty>().unwrap(),)* )
    }}
}

#[allow(unused_macros)]
macro_rules! W {
    ( $x:expr ) => {{
        println!("{}", $x);
    }};
    ( $x:expr, $($xs:expr),* ) => {{
        print!("{} ", $x);
        W!($($xs),*);
    }}
}

#[allow(unused_macros)]
macro_rules! join {
    ($x:expr, $($xs:expr),*; $sep:expr) => { concat!($x, $($sep, $xs),*) }
}

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

// }}}

fn main() {
    let (x, ) = R!(usize);
    let mut ans = 0;
    for i in 0.. {
        if (x >> i) == 0 {
            break;
        }
        ans += (x >> i) % 2;
    }
    println!("{}", ans);
}

use std::io;
fn main(){
    let mut s:String=String::new();
    io::stdin().read_line(&mut s).unwrap();
    let mut a:i64=s.trim().parse::<i64>().unwrap();
    let mut sum:i64=0;
    while a!=0{
        sum+=a%2;
        a/=2;
    }
    println!("{}",sum);
}

use std::io;

fn read_line() -> (i32) {
    let mut input = String::new();

    io::stdin().read_line(&mut input).unwrap();

    let n: i32 = input.trim().parse().unwrap();

    n
}

fn main(){

    let mut n  = read_line();
    let mut bacterias = 0;

    while n > 0 {
        bacterias += n % 2;
        n = n /2;
    }

    println!("{}", bacterias);
}

// https://codeforces.com/problemset/problem/579/A
use std::io;

fn main() {
    let mut n = String::new();

    io::stdin()
        .read_line(&mut n)
        .unwrap();

    let n: i64 = n.trim().parse().unwrap();

    let mut ans = 0;

    for bit in 0..64 {
        if (n & (1<<bit)) > 0 {
            ans += 1;
        }
    }

    println!("{}", ans);
}

#[allow(unused_imports)]
use std::io;
use std::cmp::{min, max};
use std::mem;
use std::str::FromStr;
pub struct Scanner<B> {
    reader: B,
    buffer: Vec<String>,
}

impl<B: io::BufRead> Scanner<B> {
    pub fn new(reader: B) -> Scanner<B> {
        Scanner {
            reader: reader,
            buffer: Vec::new(),
        }
    }

    /// Use "turbofish" syntax next::<T>() to select data type of next token.
    pub fn next<T: ::std::str::FromStr>(&mut self) -> T
        where
            T::Err: ::std::fmt::Debug,
    {
        if let Some(front) = self.buffer.pop() {
            front.parse::<T>().expect(&front)
        } else {
            let mut input = String::new();
            self.reader.read_line(&mut input).expect("Line not read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
            self.next()
        }
    }

    pub fn next_vec<T: ::std::str::FromStr>(&mut self, len: usize) -> Vec<T>
        where
            T::Err: ::std::fmt::Debug,
    {
        (0..len).map(|_| self.next::<T>()).collect::<Vec<T>>()
    }
}

fn main1() {
    let stdin = io::stdin();
    let mut input = Scanner::new(stdin.lock());
    let n = input.next::<u64>();
    println!("{}", n.count_ones());

}

fn main() {
    std::thread::Builder::new().stack_size(50 << 20)
        .spawn(main1).unwrap().join().unwrap();
}

struct Scan {
    buffer: std::collections::VecDeque<String>
}

impl Scan {
    fn new() -> Scan {
        Scan { buffer: std::collections::VecDeque::new() }
    }

    fn next<T: std::str::FromStr>(&mut self)-> T {
        loop {
            if let Some(token) = self.buffer.pop_front() {
                break token.parse::<T>().ok().unwrap();
            }
            let mut line = String::new();
            std::io::stdin().read_line(&mut line).expect("Fail to read");
            self.buffer = line.split_whitespace().map(String::from).collect();
        }
    }

}

fn _main() {
    let mut scan = Scan::new();
    let mut n: usize = scan.next();
    let mut x: usize = 0;
    while n>0 {
        if n&1 == 1 {
            x += 1;
        }
        n >>= 1;
    }
    println!("{}", x);
}

fn main() {
    std::thread::Builder::new()
        .stack_size(1<<23).spawn(_main).unwrap().join().unwrap();
}

use std::io;

fn read_line() -> String {
    let mut input_line = String::new();
    io::stdin().read_line(&mut input_line).unwrap();
    return String::from(input_line.trim());
}

fn main() {
    let n: usize = read_line().parse().unwrap();
    println!("{}", n.count_ones());
}

use std::io;

fn read_line() -> (i64) {
    let mut input = String::new();

    io::stdin().read_line(&mut input).unwrap();

    let n: i64 = input.trim().parse().unwrap();

    n
}

fn main(){

    let n  = read_line();

    if n % 2 == 0 {
        println!("1");
    } else {
        println!("2");
    }

}

use std::io;

fn read_line() -> (f64) {
    let mut input = String::new();

    io::stdin().read_line(&mut input).unwrap();

    let n: f64 = input.trim().parse().unwrap();

    n
}

fn main(){

    let n  = read_line();

    let log = n.log2().floor();
    let bacterias = 1.0 + (n - (2.0 as f64).powf(log));

    println!("{}", bacterias as i64);
}


Mahmoud and Ehab play a game called the even-odd game. Ehab chooses his favorite integer n and then they take turns, starting from Mahmoud. In each player's turn, he has to choose an integer a and subtract it from n such that:  1 ≤ a ≤ n.  If it's Mahmoud's turn, a has to be even, but if it's Ehab's turn, a has to be odd. If the current player can't choose any number satisfying the conditions, he loses. Can you determine the winner if they both play optimally?

The only line contains an integer n (1 ≤ n ≤ 109), the number at the beginning of the game.

Output "Mahmoud" (without quotes) if Mahmoud wins and "Ehab" (without quotes) otherwise.

NoteIn the first sample, Mahmoud can't choose any integer a initially because there is no positive even integer less than or equal to 1 so Ehab wins.In the second sample, Mahmoud has to choose a = 2 and subtract it from n. It's Ehab's turn and n = 0. There is no positive odd integer less than or equal to 0 so Mahmoud wins.

fn main() {
    let mut input = String::new();

    std::io::stdin().read_line(&mut input).expect("INPUT::Read line failed!");

    let number = input.trim().parse::<i32>().expect("NUMBER::Parse to i32 failed!");

    if number % 2 == 0 {
        println!("Mahmoud");
    }else {
        println!("Ehab");
    }
}

use std::io::stdin;

// M => choose EVEN and choose FIRST
// E => odd

fn main() {
    let mut buffer = String::new();
    let _ = stdin().read_line(&mut buffer);

    let number: u32 = buffer.trim().parse().expect("Error in parsing");

    if number % 2 == 0 {
        println!("Mahmoud");
    } else {
        println!("Ehab");
    }
}

//spnauti-rust
#[allow(unused_macros)]
macro_rules! a {
    ($c: tt, $x: expr, $y: expr) => {{
        let b = $y; let a = &mut $x;
        if b $c *a { *a = b; true } else { false }
    }};
}
use std::io::*;
use std::str::*;
use std::fmt::Debug;
struct WordReader<'a> { it : SplitAsciiWhitespace<'a>, }
#[allow(dead_code)]
impl<'a> WordReader<'a> {
    fn new<T: Read>(b: &mut String, mut r: T) -> WordReader {
        b.clear();
        r.read_to_string(b).unwrap();
        WordReader { it: b.split_ascii_whitespace() }
    }
    fn from_stdin(b: &mut String) -> WordReader {
        WordReader::new(b, stdin())
    }
    fn sl(&mut self) ->  &str { self.it.next().unwrap() }
    fn bs(&mut self) -> &[u8] { self.sl().as_bytes()    }
    fn s(&mut self) -> String { String::from(self.sl()) }
    fn i(&mut self) ->    i32 { self.p()                }
    fn u(&mut self) ->  usize { self.p()                }
    fn vi(&mut self, n: usize) -> Vec<i32> {
        self.vp::<i32>(n)
    }
    fn p<T: FromStr>(&mut self) -> T where T::Err: Debug {
        self.sl().parse::<T>().unwrap()
    }
    fn vp<T: FromStr>(&mut self, n: usize) -> Vec<T> where T::Err: Debug {
        (0..n).map(|_| self.p()).collect()
    }
}

fn main() {
    let mut bin = String::new();
    let mut input = WordReader::from_stdin(&mut bin);

    println!("{}", ["Mahmoud","Ehab"][input.u() % 2]);
}

use std::io;

fn get_winner(num: u32) -> &'static str {
    if num % 2 == 0 {
        "Mahmoud"
    } else {
        "Ehab"
    }
}

pub fn solution() -> io::Result<()> {
    let mut number = String::new();

    io::stdin().read_line(&mut number)?;
    let number = number.trim().parse::<u32>().unwrap();

    println!("{}", get_winner(number));
    Ok(())
}

fn main() {
    solution();
}

use std::io::{BufReader, BufRead};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut n = BufReader::new(std::io::stdin())
        .lines()
        .next()
        .unwrap()?
        .parse::<usize>()?;

    if n & 1 == 0 {
        println!("Mahmoud");
    } else {
        println!("Ehab");
    }

    Ok(())
}

fn main() {
  let mut s = String::new();
  std::io::stdin().read_line(&mut s).unwrap();
  let n : i32 = s.trim().parse().unwrap();
  println!("{}", if n%2==0 {"Mahmoud"} else {"Ehab"});
}

use std::io;

fn get_line() -> io::Result<String> {
	let mut buffer = String::new();

	io::stdin().read_line(&mut buffer)?;
	Ok(buffer)
}

fn main() {
	let input = get_line().unwrap();
	let n: u32 = input.trim().parse().unwrap();

	print!("{}", if n % 2 == 0 { "Mahmoud" } else { "Ehab" });
}

use std::io;

fn main() {

    let mut line = String::new();
    io::stdin().read_line(&mut line).expect("Failed to read line");
    let n = line.trim().parse::<u64>().unwrap();

    if n % 2 == 0 {
        println!("Mahmoud")
    } else {
        println!("Ehab")
    }
}

fn main() {
    use std::io::prelude::*;
    use std::io;

    let mut input = String::new();

    io::stdin().read_to_string(&mut input).unwrap();

    let n: u32 = input.trim().parse().unwrap();

    if n % 2 == 1 {
        println!("Ehab");
    } else {
        println!("Mahmoud");
    }
}

use std::io;

fn main() {
	let mut n = String::new();
	io::stdin().read_line(&mut n).expect("Time to panic");
	let n: u64 = n.trim().parse().unwrap();
	if n % 2 != 0 {
		println!("Ehab");
	} else {
		println!("Mahmoud")
	}
}

use std::io;

pub fn main() {
    let input = get_input();
    match input % 2 {
        0 => println!("Mahmoud"),
        _ => println!("Ehab"),
    };
}

fn get_input() -> u64 {
    let mut input = String::new();
    io::stdin().read_line(&mut input);
    input.trim().parse::<u64>().unwrap()
}

fn main() {
    let mut num = String::new();
    std::io::stdin().read_line(&mut num).unwrap();
    let num: u64 = num.trim().parse().unwrap();

    let ans = match num % 2 {
        0 => &"Mahmoud",
        1 => &"Ehab",
        _ => &"",
    };

    println!("{}", ans);
}

struct Scan {
    buffer: std::collections::VecDeque<String>,
}

impl Scan {
    fn new() -> Scan {
        Scan {
            buffer: std::collections::VecDeque::new(),
        }
    }

    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop_front() {
                break token.parse::<T>().ok().unwrap();
            }
            let mut line = String::new();
            std::io::stdin().read_line(&mut line).expect("Fail to read");
            self.buffer = line.split_whitespace().map(String::from).collect();
        }
    }
}

fn _main() {
    let mut scan = Scan::new();
    let n: usize = scan.next();
    println!("{}", if n % 2 == 0 { "Mahmoud" } else { "Ehab" });
}

fn main() {
    std::thread::Builder::new()
        .stack_size(1 << 23)
        .spawn(_main)
        .unwrap()
        .join()
        .unwrap();
}

use procon::*;
use std::io;
fn main() {
    try_main().unwrap();
}

fn try_main() -> Result<(), Box<std::error::Error>> {
    let stdin = io::stdin();
    let mut sc = Scanner::new(stdin.lock());
    let n = sc.next::<usize>();
    if n % 2 == 0 {
        println!("Mahmoud");
    } else {
        println!("Ehab");
    }
    Ok(())
}

mod procon {
    use std::io;
    use std::cmp::Ordering;
    /// Scanner is taken from https://github.com/EbTech/rust-algorithms
    pub struct Scanner<B> {
        reader: B,
        buffer: Vec<String>,
    }

    impl<B: io::BufRead> Scanner<B> {
        pub fn new(reader: B) -> Self {
            Self {
                reader,
                buffer: Vec::new(),
            }
        }

        pub fn next<T: ::std::str::FromStr>(&mut self) -> T
            where
            T::Err: ::std::fmt::Debug,
        {
            if let Some(front) = self.buffer.pop() {
                front.parse::<T>().expect(&front)
            } else {
                let mut input = String::new();
                self.reader.read_line(&mut input).expect("Line not read");
                self.buffer = input.split_whitespace().rev().map(String::from).collect();
                self.next()
            }
        }
    }

    pub fn merge<'a, T>(this: &'a [T], that: &'a [T], out: &'a mut [T])
        where T: Ord + Copy {
        let mut i = 0;
        let mut j = 0;
        let mut oind = 0;
        while i < this.len() && j < that.len() {
            if this[i] <= that[j] {
                out[oind] = this[i];
                i += 1;
            } else {
                out[oind] = that[j];
                j += 1;
            }
            oind += 1;
        }
        while i < this.len() {
            out[oind] = this[i];
            i += 1;
            oind += 1;
        }
        while j < that.len() {
            out[oind] = that[j];
            j += 1;
            oind += 1;
        }
    }

    /// trait for implementing functions to get lower/upper bounds (implementation is based on the rust std library)
    /// the functions return OK(indx) if self[indx] is the element we queried.
    /// e.g., in lower_bound_by, f(self[indx]) returns Ordering::Equal if the function returned Ok(indx).
    /// Further, if all the elements are less than the queried value, lower_bound/upper_bound must return Err(self.len()).
    /// Similarly, all the elements are greater than the queried value, they must return Err(0).
    pub trait CmpSearch {
        type Item;

        fn find_bound_by<'a, F>(&'a self, f: F, is_lower: bool) -> Result<usize, usize>
            where F: FnMut(&'a Self::Item) -> Ordering;

        fn find_bound_by_key<'a, B, F>(&'a self, b: &B, f: F, is_lower: bool) -> Result<usize, usize>
            where F: FnMut(&'a Self::Item) -> B,
                  B: Ord;

        /// returns Result<usize, usize> which contains the lowest index indx that satisfies the following condition,
        /// assuming that self is already sorted:
        /// 1. self[i] < x if i < indx
        /// 2. self[i] >= x if i >= indx
        /// 3. self.insert(indx, x) keeps the sorted order.
        /// The return value is Ok(indx) if there is an index that satisfies x.cmp(self[indx]) == Ordering::Equal.
        /// Otherwise the return value is Err(indx).
        ///
        fn lower_bound(&self, x: &Self::Item) -> Result<usize, usize>
            where Self::Item: Ord {
            self.find_bound_by(|elem| { elem.cmp(x) }, true)
        }

        /// returns Result<usize, usize> which contains the highest index indx that satisfies the following condition,
        /// assuming that self is already sorted:
        /// 1. self[i] <= x if i <= indx
        /// 2. self[i] > x if i > indx
        /// 3. self.insert(indx, x) keeps the sorted order.
        /// The return value is Ok(indx) if there is an index that satisfies x.cmp(self[indx]) == Ordering::Equal.
        /// Otherwise the return value is Err(indx).
        ///
        fn upper_bound(&self, x: &Self::Item) -> Result<usize, usize>
            where Self::Item: Ord {
            self.find_bound_by(|elem| { elem.cmp(x) }, false)
        }
    }

    impl<T> CmpSearch for [T] {
        type Item = T;

        /// loop invariants (if is_lower = true):
        /// 1. f(self[lb]) == Less, assuming that lb >= 0
        /// 2. f(self[ub]) == Greater or Equal, assuming that gb < self.len()
        /// 3. lb < ub; in particular, lb != ub
        ///
        /// after the loop:
        /// 1. if ub < self.len(), ub is a valid index in the slice
        /// 2. if lb == -1, ub == 0 and:
        ///   2-1. f(self[0]) == Equal then the return value is Ok(0)
        ///   2-2. f(self[0]) == Greater then the return value is Err(0)
        /// 3. if ub == self.len(), lb == self.len() - 1 and the return value is Err(self.len())
        ///
        /// a similar set of conditions holds if is_lower = false.
        ///
        fn find_bound_by<'a, F>(&'a self, mut f: F, is_lower: bool) -> Result<usize, usize>
            where F: FnMut(&'a Self::Item) -> Ordering {
            let mut lb: isize = -1;
            let mut ub: isize = self.len() as isize;
            let mut step = (ub - lb) / 2;
            while step > 0 {
                let m = (lb + step) as usize;
                match f(&self[m]) {
                    Ordering::Less => {
                        lb = m as isize;
                    },
                    Ordering::Greater => {
                        ub = m as isize;
                    },
                    Ordering::Equal => {
                        if is_lower {
                            ub = m as isize;
                        } else {
                            lb = m as isize;
                        }
                    }
                }
                step = (ub - lb) / 2
            }

            if is_lower {
                if ub as usize == self.len() {
                    Err(self.len())
                } else {
                    let ub = ub as usize;
                    match f(&self[ub]) {
                        Ordering::Equal => {
                            Ok(ub)
                        },
                        _ => {
                            Err(ub)
                        }
                    }
                }
            } else {
                if lb == -1 {
                    Err(0)
                } else {
                    let lb = lb as usize;
                    match f(&self[lb]) {
                        Ordering::Equal => {
                            Ok(lb)
                        },
                        _ => {
                            Err(lb+1)
                        }
                    }
                }
            }
        }

        fn find_bound_by_key<'a, B, F>(&'a self, b: &B, mut f: F, is_lower: bool) -> Result<usize, usize>
            where F: FnMut(&'a Self::Item) -> B,
                  B: Ord {
            self.find_bound_by(|elem|{ f(elem).cmp(b) }, is_lower)
        }

    }
}

#[cfg(test)]
mod tests {
    use super::procon::*;

    #[test]
    fn test_find_bound_by() {
        let s = [0, 2, 2, 2, 4];
        // lower bound
        let seek = 2;
        assert_eq!(s.find_bound_by(|probe| probe.cmp(&seek), true), Ok(1));
        let seek = 1;
        assert_eq!(s.find_bound_by(|probe| probe.cmp(&seek), true), Err(1));
        let seek = -1;
        assert_eq!(s.find_bound_by(|probe| probe.cmp(&seek), true), Err(0));
        let seek = 5;
        assert_eq!(s.find_bound_by(|probe| probe.cmp(&seek), true), Err(5));
        // upper bound
        let seek = 2;
        assert_eq!(s.find_bound_by(|probe| probe.cmp(&seek), false), Ok(3));
        let seek = 1;
        assert_eq!(s.find_bound_by(|probe| probe.cmp(&seek), false), Err(1));
        let seek = 5;
        assert_eq!(s.find_bound_by(|probe| probe.cmp(&seek), false), Err(5));
        let seek = -1;
        assert_eq!(s.find_bound_by(|probe| probe.cmp(&seek), false), Err(0));
    }
}

macro_rules! parse_line {
    ($t: ty) => ({
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        let a_str = a_str.trim();
        a_str.parse::<$t>().expect("parse error")
    });
    ($($t: ty),+) => ({
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        let mut a_iter = a_str.split_whitespace();
        (
            $(
            a_iter.next().unwrap().parse::<$t>().expect("parse error"),
            )+
        )
    })
}

#[allow(unused_macros)]
macro_rules! parse_line_to_vec {
    ($t: ty) => {{
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        (a_str
            .split_whitespace()
            .map(|x| x.parse::<$t>().unwrap())
            .collect::<Vec<$t>>())
    }};
}

use std::io::Write;

fn solve(writer: &mut std::io::BufWriter<std::io::Stdout>) {
    let n = parse_line!(usize);
    let ok = n % 2 == 1;
    writeln!(writer, "{}", if ok {"Ehab"} else {"Mahmoud"}).unwrap();
}

fn main() {
    let mut writer = std::io::BufWriter::new(std::io::stdout());
    let tests = 1; // parse_line!(usize);
    for _ in 0..tests {
        solve(&mut writer);
    }
}

use std::io;

fn main() -> io::Result<()> {
    let mut input = String::new();

    io::stdin().read_line(&mut input)?;

    let n = input.trim().parse::<usize>().unwrap();

    match n % 2 {
        0 => println!("Mahmoud"),
        1 => println!("Ehab"),
        _ => println!("Invalid number"),
    }

    Ok(())
}

use std::io;

fn main() {
    let mut val = String::new();

    io::stdin().read_line(&mut val)
        .expect("Не удалось прочитать строку");

    let val: u32 = val.trim().parse()
        .expect("Пожалуйста, введите число!");

    if val % 2 == 0 {
        println!("Mahmoud");
    } else {
        println!("Ehab");
    }
}

use std::io;

fn main() {
  let mut ni = String::new();
  io::stdin().read_line(&mut ni).unwrap();
  let n: i32 = ni.trim().parse().unwrap();
  println!("{}", if (n % 2) == 0 { "Mahmoud" } else { "Ehab" });
}

#[allow(unused_imports)]
use std::cmp::{max, min};
use std::collections::{HashMap, HashSet};
use std::io::{stdin, stdout, BufWriter, Write};
const BITS: usize = 19;

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>,
}
impl Scanner {
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn solve () {
    let mut scan = Scanner::default();
    let n: usize = scan.next ();
    println! ("{}", if n%2 == 0 {"Mahmoud"} else {"Ehab"});
}

fn main() {
    let mut scan = Scanner::default();
    // let t = scan.next::<u64>();
    let t = 1;
    for _ in 0..t {
        solve();
    }
}

use std::io::stdin;
fn main() {
    let mut input = String::new();
    stdin().read_line(&mut input).unwrap();

    let num: i32 = input.trim().parse().unwrap();

    if num % 2 == 0 {
        println!("Mahmoud");
    } else {
        println!("Ehab");
    }
}

use std::io::stdin;

// M => choose EVEN and choose FIRST
// E => odd

fn main() {
    let mut buffer = String::new();
    let _ = stdin().read_line(&mut buffer);

    let number: u32 = buffer.trim().parse().expect("Error in parsing");

    if number % 2 == 0 {
        println!("Mahmoud");
    } else {
        println!("Ehad");
    }
}

use std::io;

fn get_line() -> io::Result<String> {
	let mut buffer = String::new();
	io::stdin().read_line(&mut buffer)?;
	Ok(buffer)
}

fn main() {
	let employees;
	{
		let input = get_line().unwrap();
		employees = input.trim().parse::<u32>().unwrap();
	}

	let mut ways = 0;
	for i in 1..employees {
		if (employees - i) % i == 0 {
			ways += 1;
		}
	}
	print!("{}", ways);
}

use std::io;

fn main() {
	let mut n = String::new();
	io::stdin().read_line(&mut n).expect("Time to panic");
	let n: u64 = n.trim().parse().unwrap();
	if n % 2 == 0 {
		println!("Ehab");
	} else {
		println!("Mahmoud")
	}
}

macro_rules! parse_line {
    ($t: ty) => ({
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        let a_str = a_str.trim();
        a_str.parse::<$t>().expect("parse error")
    });
    ($($t: ty),+) => ({
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        let mut a_iter = a_str.split_whitespace();
        (
            $(
            a_iter.next().unwrap().parse::<$t>().expect("parse error"),
            )+
        )
    })
}

#[allow(unused_macros)]
macro_rules! parse_line_to_vec {
    ($t: ty) => {{
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        (a_str
            .split_whitespace()
            .map(|x| x.parse::<$t>().unwrap())
            .collect::<Vec<$t>>())
    }};
}

use std::io::Write;

fn solve(writer: &mut std::io::BufWriter<std::io::Stdout>) {
    let n = parse_line!(usize);
    let ok = n == 1;
    writeln!(writer, "{}", if ok {"Ehab"} else {"Mahmoud"}).unwrap();
}

fn main() {
    let mut writer = std::io::BufWriter::new(std::io::stdout());
    let tests = 1; // parse_line!(usize);
    for _ in 0..tests {
        solve(&mut writer);
    }
}


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.

#[allow(unused)] use std::io::*;
#[allow(unused)] use std::collections::*;
#[allow(unused)] use std::mem::*;
#[allow(unused)] use std::num::*;
#[allow(unused)] use std::cmp::*;
#[allow(unused)] macro_rules! scan { ($($x:ty), +) => {{
    let mut inp = String::new(); stdin().read_line(&mut inp).ok();
    let s = inp.split(' ').map(|x| x.trim()).filter(|x| x.len() != 0).collect();
    let mut cnt : usize = 0;
    fn next<T>(cnt: &mut usize, p: &Vec<&str>) -> T where T:std::str::FromStr
    { *cnt += 1; p[*cnt-1].parse().ok().unwrap() }
    ($(next::<$x>(&mut cnt, &s)), +)
    }}; }
#[allow(unused)] macro_rules! arr { ($n:expr, $T:ty) => {{
    let mut inp = String::new(); stdin().read_line(&mut inp).ok();
    let mut s = inp.split(' ').map(|x| x.trim()).filter(|x| x.len() != 0);
    let mut v = Vec::new(); v.reserve(($n) as usize);
    for st in s { v.push(st.parse::<$T>().unwrap()); } v
    }}; }

///////////////////////////////////////////////////////////////////////////////
fn main()
{
    let a = scan!(i32);
    let b = scan!(i32);
    let c = scan!(i32);
    println!("{}", max(max(max(max(max(
        a + b + c,
        a * b * c),
        (a + b) * c),
        a + b * c),
        a * (b + c)),
        a * b + c));
}

fn input() -> u16 {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

fn main() {
    let (a, b, c) = (input(), input(), input());
    println!(
        "{}",
        [
            a + b + c,
            a + b * c,
            a * b + c,
            a * b * c,
            (a + b) * c,
            a * (b + c)
        ]
        .iter()
        .max()
        .unwrap()
    );
}

//spnauti-rust
#[allow(unused_imports)]
use std::io::{self,Read};

struct WordReader {
    it : std::vec::IntoIter<String>,
}
#[allow(dead_code)]
impl WordReader {
    fn new<T : Read>(mut reader : T) -> WordReader {
        let mut s = String::new();
        reader.read_to_string(&mut s).unwrap();
        WordReader { it : s
            .split_ascii_whitespace()
            .map(String::from).collect::<Vec<_>>()
            .into_iter()
        }
    }
    fn from_stdin() -> WordReader {
        WordReader::new(std::io::stdin())
    }
    fn s(&mut self) -> String {
        self.it.next().unwrap()
    }
    fn ab(&mut self) -> Vec<u8> {
        self.it.next().unwrap().into_bytes()
    }
    fn i(&mut self) -> i32 {
        self.it.next().unwrap().parse().unwrap()
    }
}

fn main() {
    let mut input = WordReader::from_stdin();
    let a = input.i();
    let b = input.i();
    let c = input.i();

    use std::cmp::max;
    let ab = max(a + b, a * b);
    let bc = max(b + c, b * c);
    let p = [ab + c, ab * c, a + bc, a * bc];
    let sol = p.iter().max().unwrap();
    println!("{}", sol);
}

fn main() {
    let a: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };
    let b: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };
    let c: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let best = |a, b| std::cmp::max(a + b, a * b);
    let x = std::cmp::max(best(best(a, b), c), best(a, best(b, c)));
    println!("{:?}", x);
}

use std::io;

fn main() {
    let (mut a, mut b, mut c) = (String::new(), String::new(), String::new());
    io::stdin().read_line(&mut a).unwrap();
    io::stdin().read_line(&mut b).unwrap();
    io::stdin().read_line(&mut c).unwrap();
    let a: i64 = a.trim().parse().unwrap();
    let b: i64 = b.trim().parse().unwrap();
    let c: i64 = c.trim().parse().unwrap();

    let posibles: [i64; 6] = [
        (a + b) * c,
        a * (b + c),
        a + b + c,
        a * b + c,
        a + b * c,
        a * b * c,
    ];

    let max = posibles.iter().max().unwrap();

    println!("{}", max);
}

// {{{ by shik

use std::io;

#[allow(dead_code)]
fn gets() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(unused_macros)]
macro_rules! R {
    ( $ty:ty, ... ) => {
        gets().split_whitespace().map(|x| x.parse::<$ty>().unwrap()).collect::<Vec<_>>()
    };
    ( $($ty:ty),* ) => {{
        let line = gets();
        let mut it = line.split_whitespace();
        ( $(it.next().unwrap().parse::<$ty>().unwrap(),)* )
    }}
}

#[allow(unused_macros)]
macro_rules! W {
    ( $x:expr ) => {{
        println!("{}", $x);
    }};
    ( $x:expr, $($xs:expr),* ) => {{
        print!("{} ", $x);
        W!($($xs),*);
    }}
}

#[allow(unused_macros)]
macro_rules! join {
    ($x:expr, $($xs:expr),*; $sep:expr) => { concat!($x, $($sep, $xs),*) }
}

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

// }}}

use std::cmp;

fn main() {
    let (a, ) = R!(i32);
    let (b, ) = R!(i32);
    let (c, ) = R!(i32);
    println!("{}", vec![a+b+c, a+b*c, a*b+c, a*b*c, (a+b)*c, a*(b+c)].into_iter().fold(0, cmp::max));
}

use std::io;
use std::cmp::max;

fn main() {
  let stdin = io::stdin();
  let mut s = String::new();
  stdin.read_line(&mut s).unwrap();
  let a: i32 = s.trim().parse().unwrap();
  let mut s = String::new();
  stdin.read_line(&mut s).unwrap();
  let b: i32 = s.trim().parse().unwrap();
  let mut s = String::new();
  stdin.read_line(&mut s).unwrap();
  let c: i32 = s.trim().parse().unwrap();

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

  println!("{}", x);
  return;
}

use std::io::*;

fn read<T: std::str::FromStr>(i: &mut StdinLock) -> T {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    // initialize stdin
    let sin = std::io::stdin();
    let mut sin = sin.lock();
    let sin = &mut sin;

    let a: i64 = read(sin);
    let b: i64 = read(sin);
    let c: i64 = read(sin);

    let ans = match (a, b, c) {
        (1, 1, 1) => 3,
        (a, 1, c) => if a < c {
            (a + 1) * c
        } else {
            a * (c + 1)
        },
        (1, b, 1) => b + 2,
        (1, b, c) => (1 + b) * c,
        (a, b, 1) => a * (b + 1),
        _ => a * b * c,
    };

    println!("{}", ans);
}

use std::io::*;

fn read<T: std::str::FromStr>(i: &mut StdinLock) -> T {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    // initialize stdin
    let sin = std::io::stdin();
    let mut sin = sin.lock();
    let sin = &mut sin;

    let a: i64 = read(sin);
    let b: i64 = read(sin);
    let c: i64 = read(sin);

    if b == 1 {
        let ans = if a <= c {
            if c == 1 {
                // a == b == c == 1
                a + b + c
            } else {
                (a + b) * c
            }
        } else {
            a * (b + c)
        };
        println!("{}", ans);
        return;
    }

    if c == 1 && a != 1 {
        println!("{}", a * (b + c));
        return;
    }

    let pre_val = if a == 1 { a + b } else { a * b };
    let ans = if c == 1 { pre_val + c } else { pre_val * c };

    println!("{}", ans);
}

use std::io;

fn main() {
    let mut a = String::new();
    let mut b = String::new();
    let mut c = String::new();

    io::stdin()
        .read_line(&mut a)
        .unwrap();

    io::stdin()
        .read_line(&mut b)
        .unwrap();

    io::stdin()
        .read_line(&mut c)
        .unwrap();

    let a: i64 = a.trim().parse().unwrap();
    let b: i64 = b.trim().parse().unwrap();
    let c: i64 = c.trim().parse().unwrap();

    println!("{}",
             [
        (a+b)*c,
        a*b+c,
        a+b*c,
        a+b+c,
        a*b*c,
        a*(b+c)
    ]
    .iter()
    .max()
    .unwrap()
    );
}

use std::io;

fn main() {
    let mut a = String::new();
    let mut b = String::new();
    let mut c = String::new();

    io::stdin()
        .read_line(&mut a)
        .unwrap();

    io::stdin()
        .read_line(&mut b)
        .unwrap();

    io::stdin()
        .read_line(&mut c)
        .unwrap();

    let a: i64 = a.trim().parse().unwrap();
    let b: i64 = b.trim().parse().unwrap();
    let c: i64 = c.trim().parse().unwrap();

    let mut maxima = 0;
    let uno = (a+b)*c;
    let dos = a*b+c;
    maxima = std::cmp::max(uno,dos);
    let tres = a+b*c;
    maxima = std::cmp::max(maxima,tres);
    let cuatro = a+b+c;
    maxima = std::cmp::max(maxima,cuatro);
    let cinco = a*b*c;
    maxima = std::cmp::max(maxima,cinco);
    let seis = a*(b+c);
    maxima = std::cmp::max(maxima,seis);

    println!("{}", maxima);
}

use std::str::FromStr;

fn read_str() -> String {
    let mut buffer: String = String::new();
    std::io::stdin().read_line(&mut buffer).expect("Error");
    buffer.trim().to_string()
}

fn read_int<T: FromStr>() -> T{
    read_str().parse::<T>().ok().expect("Error")
}

fn main() {
    let (a, b, c): (u16, u16, u16) = (read_int(), read_int(), read_int());

    if a == 1 {
        if c == 1 { println!("{}", a + b + c); }
        else { println!("{}", (a + b) * c); }
    }
    else if b == 1 {
        if a > c { println!("{}", a * (b + c)); }
        else { println!("{}", (a + b) * c); }
    }
    else if c == 1 { println!("{}", a * (b + c)); }
    else { println!("{}", a * b * c); }
}

use std::str::FromStr;

fn read_str() -> String {
    let mut buffer: String = String::new();
    std::io::stdin().read_line(&mut buffer).expect("Error");
    buffer.trim().to_string()
}

fn read_int<T: FromStr>() -> T{
    read_str().parse::<T>().ok().expect("Error")
}

fn main() {
    let (a, b, c): (u16, u16, u16) = (read_int(), read_int(), read_int());

    if a + c == 2 { println!("{}", a + b + c); }
    else if a == 1 || b == 1 || c == 1 {
        if a < c { println!("{}", (a + b) * c); }
        else { println!("{}", a * (b + c)); }
    }
    else { println!("{}", a * b * c); }
}

use std::io;
use std::io::Stdin;
use std::str::FromStr;

fn read_line(stdin : &Stdin, line : &mut String) {
    match stdin.read_line(line) {
        Ok(_) => return,
        Err(msg) => panic!("Could not read line! Message: {}.", msg),
    }
}

fn parse_t<T : FromStr>(s : &str) -> T {
    match s.trim().parse() {
        Ok(y) => y,
        Err(_) => panic!("Could not read from string!"),
    }
}

fn read_t<T : FromStr>(stdin : &Stdin) -> T {
    let mut line = String::new();
    read_line(stdin, &mut line);
    parse_t(&line)
}

fn max_value(a : u64, b : u64, c : u64) -> u64 {
    let v = vec![a + b + c,
                 (a + b) * c,
                 (a * b) + c,
                 a * b * c,
                 a + (b * c),
                 a * (b + c)];
    match v.iter().max() {
        Some(&x) => x,
        None => panic!("Could not compute max value."),
    }
}

fn main() {
    let stdin = io::stdin();
    let a = read_t(&stdin);
    let b = read_t(&stdin);
    let c = read_t(&stdin);
    println!("{}", max_value(a, b, c));
}

fn readln() -> Vec<i32> {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();

    line.split_whitespace()
        .map(|s| s.parse().unwrap())
        .collect()
}

fn main() {
    let input = readln();
    let a = input[0];

    let input = readln();
    let b = input[0];

    let input = readln();
    let c = input[0];

    let mut ans = 0;

    // a + b + c
    ans = std::cmp::max(ans, a + b + c);

    // a + b * c
    ans = std::cmp::max(ans, a + b * c);

    // a * b + c
    ans = std::cmp::max(ans, a * b + c);

    // a * b * c
    ans = std::cmp::max(ans, a * b * c);

    // (a + b) * c
    ans = std::cmp::max(ans, (a + b) * c);

    // a * (b + c)
    ans = std::cmp::max(ans, a * (b + c));

    println!("{}", ans);
}

// use rand::Rng;

use std::collections::*;
use std::io;

fn trim_newline(s: &mut String) {
    if s.ends_with('\n') {
        s.pop();
        if s.ends_with('\r') {
            s.pop();
        }
    }
}
macro_rules! parse_input {
    ($t:ident) => {{
        let mut input_line = String::new();
        io::stdin().read_line(&mut input_line).unwrap();
        trim_newline(&mut input_line);
        input_line.parse::<$t>().unwrap()
    }};
}

macro_rules! split_input {
    ($t:ident) => {{
        parse_input!(String)
            .split(" ")
            .map(|z| z.parse::<$t>().unwrap())
            .collect::<Vec<$t>>()
    }};
}

fn main() {
    let mut a = parse_input!(usize);
    let mut b = parse_input!(usize);
    let mut c = parse_input!(usize);
    if a == 1 {
        b += 1;
    }
    if b == 1 {
        if c < a {
            c += 1;
        } else {
            a += 1;
        }
    }
    if c == 1 {
        b += 1;
    }

    println!("{}", a * b * c);
}

use std::io;

fn main() {
    let mut a = String::new();
    let mut b = String::new();
    let mut c = String::new();

    io::stdin().read_line(&mut a).unwrap();
    io::stdin().read_line(&mut b).unwrap();
    io::stdin().read_line(&mut c).unwrap();

    let a: u16 = a.trim().parse().unwrap();
    let b: u16 = b.trim().parse().unwrap();
    let c: u16 = c.trim().parse().unwrap();

    let mut max_value: u16 = 0;

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

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

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

    println!("{}", max_value);
}

use std::io;

fn read_line() -> String {
    let mut input_line = String::new();
    io::stdin().read_line(&mut input_line).unwrap();
    return String::from(input_line.trim());
}

fn read_line_val() -> i32 {
    return read_line().parse().unwrap();
}

fn main() {
    let a = read_line_val();
    let b = read_line_val();
    let c = read_line_val();

    let results: [i32; 6] = [
        a + b + c,
        a + b * c,
        (a + b) * c,
        a * b + c,
        a * (b + c),
        a * b * c
    ];

    let mut max = 0;
    for r in results.iter() {
        if *r > max {
            max = *r;
        }
    }

    println!("{:?}", max);

}

use std::io::{BufWriter, stdin, stdout, Write};

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>
}
impl Scanner {
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn main() {
    let mut scan = Scanner::default();
    let out = &mut BufWriter::new(stdout());

	let a = scan.next::<i64>();
	let b = scan.next::<i64>();
	let c = scan.next::<i64>();

    let nums = [a + b + c,
               a + b * c,
               a * b * c,
               (a + b) * c,
               a * b + c,
               a * (b + c)];

    let res = nums.iter().max().unwrap();

    writeln!(out, "{}", res).expect("fail");
}

#[allow(unused)] use std::io::*;
#[allow(unused)] use std::collections::*;
#[allow(unused)] use std::mem::*;
#[allow(unused)] use std::num::*;
#[allow(unused)] use std::cmp::*;
#[allow(unused)] macro_rules! scan { ($($x:ty), +) => {{
    let mut inp = String::new(); stdin().read_line(&mut inp).ok();
    let s = inp.split(' ').map(|x| x.trim()).filter(|x| x.len() != 0).collect();
    let mut cnt : usize = 0;
    fn next<T>(cnt: &mut usize, p: &Vec<&str>) -> T where T:std::str::FromStr
    { *cnt += 1; p[*cnt-1].parse().ok().unwrap() }
    ($(next::<$x>(&mut cnt, &s)), +)
    }}; }
#[allow(unused)] macro_rules! arr { ($n:expr, $T:ty) => {{
    let mut inp = String::new(); stdin().read_line(&mut inp).ok();
    let mut s = inp.split(' ').map(|x| x.trim()).filter(|x| x.len() != 0);
    let mut v = Vec::new(); v.reserve(($n) as usize);
    for st in s { v.push(st.parse::<$T>().unwrap()); } v
    }}; }

///////////////////////////////////////////////////////////////////////////////
fn main()
{
    let a = scan!(i32);
    let b = scan!(i32);
    let c = scan!(i32);
    println!("{}", max(max(max(a + b + c, a * b * c), (a + b) * c), a + b * c));
}

#[allow(unused)] use std::io::*;
#[allow(unused)] use std::collections::*;
#[allow(unused)] use std::mem::*;
#[allow(unused)] use std::num::*;
#[allow(unused)] use std::cmp::*;
#[allow(unused)] macro_rules! scan { ($($x:ty), +) => {{
    let mut inp = String::new(); stdin().read_line(&mut inp).ok();
    let s = inp.split(' ').map(|x| x.trim()).filter(|x| x.len() != 0).collect();
    let mut cnt : usize = 0;
    fn next<T>(cnt: &mut usize, p: &Vec<&str>) -> T where T:std::str::FromStr
    { *cnt += 1; p[*cnt-1].parse().ok().unwrap() }
    ($(next::<$x>(&mut cnt, &s)), +)
    }}; }
#[allow(unused)] macro_rules! arr { ($n:expr, $T:ty) => {{
    let mut inp = String::new(); stdin().read_line(&mut inp).ok();
    let mut s = inp.split(' ').map(|x| x.trim()).filter(|x| x.len() != 0);
    let mut v = Vec::new(); v.reserve(($n) as usize);
    for st in s { v.push(st.parse::<$T>().unwrap()); } v
    }}; }

///////////////////////////////////////////////////////////////////////////////
fn main()
{
    let a = scan!(i32);
    let b = scan!(i32);
    let c = scan!(i32);
    println!("{}", max(max(max(max(a + b + c, a * b * c), (a + b) * c), (a + c) * b), (b + c) * a));
}

fn input() -> u8 {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

fn main() {
    let (a, b, c) = (input(), input(), input());
    println!(
        "{}",
        [
            a + b + c,
            a + b * c,
            a * b + c,
            a * b * c,
            (a + b) * c,
            a * (b + c)
        ]
        .iter()
        .max()
        .unwrap()
    );
}

use std::io;
use std::cmp::{min, max};

fn main() {
  let stdin = io::stdin();
  let mut s = String::new();
  stdin.read_line(&mut s).unwrap();
  let a: i32 = s.trim().parse().unwrap();
  let mut s = String::new();
  stdin.read_line(&mut s).unwrap();
  let b: i32 = s.trim().parse().unwrap();
  let mut s = String::new();
  stdin.read_line(&mut s).unwrap();
  let c: i32 = s.trim().parse().unwrap();

  let x = min(a, min(b, c));
  let z = max(a, max(b, c));
  let y = a + b + c - x - z;

  if x == 1 && y == 1 && z == 1 {
    println!("3");
  } else if x == 1 && y == 1 {
    println!("{}", 2*z);
  } else if x == 1 {
    println!("{}", (y+1)*z);
  } else {
    println!("{}", x*y*z);
  }
}

use std::io::*;

fn read<T: std::str::FromStr>(i: &mut StdinLock) -> T {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    // initialize stdin
    let sin = std::io::stdin();
    let mut sin = sin.lock();
    let sin = &mut sin;

    let a: i64 = read(sin);
    let b: i64 = read(sin);
    let c: i64 = read(sin);

    let pre_val = if a == 1 || b == 1 { a + b } else { a * b };

    let ans = if c == 1 { pre_val + c } else { pre_val * c };

    println!("{}", ans);
}

use std::io::*;

fn read<T: std::str::FromStr>(i: &mut StdinLock) -> T {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    // initialize stdin
    let sin = std::io::stdin();
    let mut sin = sin.lock();
    let sin = &mut sin;

    let a: i8 = read(sin);
    let b: i8 = read(sin);
    let c: i8 = read(sin);

    let pre_val = if a == 1 || b == 1 { a + b } else { a * b };

    let ans = if c == 1 { pre_val + c } else { pre_val * c };

    println!("{}", ans);
}

use std::io::*;

fn read<T: std::str::FromStr>(i: &mut StdinLock) -> T {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    // initialize stdin
    let sin = std::io::stdin();
    let mut sin = sin.lock();
    let sin = &mut sin;

    let a: i64 = read(sin);
    let b: i64 = read(sin);
    let c: i64 = read(sin);

    if b == 1 {
        let ans = if a <= c {
            if c == 1 {
                // a == b == c == 1
                a + b + c
            } else {
                (a + b) * c
            }
        } else {
            a * (b + c)
        };
        println!("{}", ans);
        return;
    }

    let pre_val = if a == 1 { a + b } else { a * b };
    let ans = if c == 1 { pre_val + c } else { pre_val * c };

    println!("{}", ans);
}

use std::str::FromStr;

fn read_str() -> String {
    let mut buffer: String = String::new();
    std::io::stdin().read_line(&mut buffer).expect("Error");
    buffer.trim().to_string()
}

fn read_int<T: FromStr>() -> T{
    read_str().parse::<T>().ok().expect("Error")
}

fn main() {
    let (a, b, c): (u8, u8, u8) = (read_int(), read_int(), read_int());

    if a == 1 {
        if c == 1 { println!("{}", a + b + c); }
        else { println!("{}", (a + b) * c); }
    }
    else if b == 1 {
        if a > c { println!("{}", a * (b + c)); }
        else { println!("{}", (a + b) * c); }
    }
    else if c == 1 { println!("{}", a * (b + c)); }
    else { println!("{}", a * b * c); }
}

use std::str::FromStr;

fn read_str() -> String {
    let mut buffer: String = String::new();
    std::io::stdin().read_line(&mut buffer).expect("Error");
    buffer.trim().to_string()
}

fn read_int<T: FromStr>() -> T{
    read_str().parse::<T>().ok().expect("Error")
}

fn main() {
    let (a, b, c): (u16, u16, u16) = (read_int(), read_int(), read_int());

    if a + c == 2 { println!("{}", a + b + c); }
    else if b == 1 || c == 1 {
        if a < c { println!("{}", (a + b) * c); }
        else { println!("{}", a * (b + c)); }
    }
    else { println!("{}", a * b * c); }
}

// use rand::Rng;

use std::collections::*;
use std::io;

fn trim_newline(s: &mut String) {
    if s.ends_with('\n') {
        s.pop();
        if s.ends_with('\r') {
            s.pop();
        }
    }
}
macro_rules! parse_input {
    ($t:ident) => {{
        let mut input_line = String::new();
        io::stdin().read_line(&mut input_line).unwrap();
        trim_newline(&mut input_line);
        input_line.parse::<$t>().unwrap()
    }};
}

macro_rules! split_input {
    ($t:ident) => {{
        parse_input!(String)
            .split(" ")
            .map(|z| z.parse::<$t>().unwrap())
            .collect::<Vec<$t>>()
    }};
}

fn main() {
    let a = parse_input!(usize);
    let b = parse_input!(usize);
    let c = parse_input!(usize);
    let mut m = vec![a, b, c];
    m.sort();
    m.reverse();
    while *m.last().unwrap() == 1 {
        let p = m.pop().unwrap();
        *m.last_mut().unwrap() += p;
    }
    let mut ans = 1;
    for p in m {
        ans *= p;
    }
    println!("{}", ans);
}

// use rand::Rng;

use std::collections::*;
use std::io;

fn trim_newline(s: &mut String) {
    if s.ends_with('\n') {
        s.pop();
        if s.ends_with('\r') {
            s.pop();
        }
    }
}
macro_rules! parse_input {
    ($t:ident) => {{
        let mut input_line = String::new();
        io::stdin().read_line(&mut input_line).unwrap();
        trim_newline(&mut input_line);
        input_line.parse::<$t>().unwrap()
    }};
}

macro_rules! split_input {
    ($t:ident) => {{
        parse_input!(String)
            .split(" ")
            .map(|z| z.parse::<$t>().unwrap())
            .collect::<Vec<$t>>()
    }};
}

fn main() {
    let a = parse_input!(usize);
    let b = parse_input!(usize);
    let c = parse_input!(usize);
    let mut m = vec![a, b, c];
    m.sort();
    m.reverse();
    while *m.last().unwrap() == 1 {
        let p = m.pop().unwrap();
        *m.last_mut().unwrap() += p;
        m.sort();
        m.reverse();
    }
    let mut ans = 1;
    for p in m {
        ans *= p;
    }
    println!("{}", ans);
}

use std::io;

fn main() {
    let mut a = String::new();
    let mut b = String::new();
    let mut c = String::new();

    io::stdin().read_line(&mut a).unwrap();
    io::stdin().read_line(&mut b).unwrap();
    io::stdin().read_line(&mut c).unwrap();

    let a: u8 = a.trim().parse().unwrap();
    let b: u8 = b.trim().parse().unwrap();
    let c: u8 = c.trim().parse().unwrap();

    let mut max_value = 0;

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

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

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

    println!("{}", max_value);
}


Year 2118. Androids are in mass production for decades now, and they do all the work for humans. But androids have to go to school to be able to solve creative tasks. Just like humans before.It turns out that high school struggles are not gone. If someone is not like others, he is bullied. Vasya-8800 is an economy-class android which is produced by a little-known company. His design is not perfect, his characteristics also could be better. So he is bullied by other androids.One of the popular pranks on Vasya is to force him to compare $$$x^y$$$ with $$$y^x$$$. Other androids can do it in milliseconds while Vasya's memory is too small to store such big numbers.Please help Vasya! Write a fast program to compare $$$x^y$$$ with $$$y^x$$$ for Vasya, maybe then other androids will respect him.

On the only line of input there are two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 10^{9}$$$).

If $$$x^y < y^x$$$, then print '<' (without quotes). If $$$x^y > y^x$$$, then print '>' (without quotes). If $$$x^y = y^x$$$, then print '=' (without quotes).

NoteIn the first example $$$5^8 = 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 = 390625$$$, and $$$8^5 = 8 \cdot 8 \cdot 8 \cdot 8 \cdot 8 = 32768$$$. So you should print '>'.In the second example $$$10^3 = 1000 < 3^{10} = 59049$$$.In the third example $$$6^6 = 46656 = 6^6$$$.

use std::io::{self, BufRead};

fn compare(x: i32, y: i32) -> i32 {
    if x == y {
        return 0;
    }
    if (x == 2 && y == 4) || (x == 4 && y == 2) {
        return 0;
    }

    if x <= 3 && y <= 3 {
        return if x < y { -1 } else { 1 };
    }
    if x >= 3 && y >= 3 {
        return if x < y { 1 } else { -1 };
    }

    if x == 1 {
        return -1;
    }
    if y == 1 {
        return 1;
    }

    if x <= 3 { 1 } else { -1 }
}

fn main() {
    let stdin = io::stdin();
    let mut input = String::new();
    stdin.lock().read_line(&mut input).unwrap();

    let tokens: Vec<&str> = input.split_whitespace().collect();
    let x = tokens[0].parse::<i32>().unwrap();
    let y = tokens[1].parse::<i32>().unwrap();

    match compare(x, y) {
        -1 => println!("<"),
         0 => println!("="),
         1 => println!(">"),
         _ => println!("This shouldn't happen...")
    };
}

use std::cmp;
use std::io;

fn main() {
    let mut mut_line = String::new();
    io::stdin().read_line(&mut mut_line).unwrap();
    let mut iter = mut_line.trim().split(" ").map(|x| x.parse().unwrap());
    let (x, y): (u64, u64) = (iter.next().unwrap(), iter.next().unwrap());
    if x == y {
        println!("=");
        return;
    }
    let mini = cmp::min(x, y);
    let other = x + y - mini;
    let mut result = if mini >= 3 {
        cmp::Ordering::Greater
    } else if mini == 1 {
        cmp::Ordering::Less
    } else {
        // mini == 2
        if other == 3{
            cmp::Ordering::Less
        } else if other == 4 {
            cmp::Ordering::Equal
        }
        else{
            cmp::Ordering::Greater
        }
    };
    if mini == y {
        result = cmp::Ordering::reverse(result);
    }
    match result{
        cmp::Ordering::Less => println!("<"),
        cmp::Ordering::Equal => println!("="),
        cmp::Ordering::Greater => println!(">")
    }
}

fn main() {
    let mut input = String::new();
    use std::io::{self, prelude::*};
    io::stdin().read_to_string(&mut input).unwrap();

    let mut it = input.split_whitespace();

    let x: u32 = it.next().unwrap().parse().unwrap();
    let y: u32 = it.next().unwrap().parse().unwrap();

    // x^y <?> y^x
    // exp(y * ln(x)) <?> exp(x * ln(y))
    // y * ln(x) <?> x * ln(y)
    // ln(x) / x <?> ln(y) / y

    struct F {
        x: u32,
    }

    use std::cmp::{Ordering, self};

    impl PartialEq for F {
        fn eq(&self, other: &F) -> bool {
            match (self.x, other.x) {
                (2, 4) | (4, 2) => true,
                (a, b) => a.eq(&b),
            }
        }
    }

    impl Eq for F {}

    impl PartialOrd for F {
        fn partial_cmp(&self, other: &F) -> Option<Ordering> {
            Some(self.cmp(other))
        }
    }

    impl Ord for F {
        fn cmp(&self, other: &F) -> Ordering {
            match (self.x, other.x) {
                (a, b) if F { x: a } == F { x: b } => Ordering::Equal,
                (3, _) => Ordering::Greater,
                (_, 3) => Ordering::Less,
                (2, _) => Ordering::Greater,
                (_, 2) => Ordering::Less,
                (1, _) => Ordering::Less,
                (_, 1) => Ordering::Greater,
                (a, b) => b.cmp(&a),
            }
        }
    }

    let x = F { x: x };
    let y = F { x: y };
    let ans = x.cmp(&y);
    let txt = match ans {
        Ordering::Less => '<',
        Ordering::Equal => '=',
        Ordering::Greater => '>',
    };

    println!("{}", txt);
}

fn main() {
    let mut input = String::new();
    use std::io::{self, prelude::*};
    io::stdin().read_to_string(&mut input).unwrap();

    let mut it = input.split_whitespace();

    let x: u32 = it.next().unwrap().parse().unwrap();
    let y: u32 = it.next().unwrap().parse().unwrap();

    // x^y <?> y^x
    // exp(y * ln(x)) <?> exp(x * ln(y))
    // y * ln(x) <?> x * ln(y)
    // ln(x) / x <?> ln(y) / y

    fn f_cmp(a: u32, b: u32) -> ::std::cmp::Ordering {
        use std::cmp::{self, Ordering};

        if a == b {
            Ordering::Equal
        } else if a == 1 {
            Ordering::Less
        } else if b == 1 {
            Ordering::Greater
        } else if a == 3 {
            Ordering::Greater
        } else if b == 3 {
            Ordering::Less
        } else if a == 2 || a == 4 {
            if b == 2 || b == 4 {
                Ordering::Equal
            } else {
                Ordering::Greater
            }
        } else if b == 2 || b == 4 {
            Ordering::Less
        } else {
            b.cmp(&a)
        }
    }

    let ans = f_cmp(x, y);
    use std::cmp::Ordering;
    let txt = match ans {
        Ordering::Less => '<',
        Ordering::Equal => '=',
        Ordering::Greater => '>',
    };

    println!("{}", txt);
}

fn main() {
    let mut input = String::new();
    use std::io::{self, prelude::*};
    io::stdin().read_to_string(&mut input).unwrap();

    let mut it = input.split_whitespace();

    let x: f64 = it.next().unwrap().parse().unwrap();
    let y: f64 = it.next().unwrap().parse().unwrap();

    // x^y <?> y^x
    // exp(y * ln(x)) <?> exp(x * ln(y))
    // y * ln(x) <?> x * ln(y)
    // ln(x) / x <?> ln(y) / y

    let epsilon = 1e-4;

    let diff = x * y.ln() - y * x.ln();

    let ans = if diff.abs() < epsilon {
        '='
    } else if diff > 0.0 {
        '<'
    } else {
        '>'
    };

    println!("{}", ans);
}

use std::io::{self, BufRead};

fn compare(x: i32, y: i32) -> i32 {
    if x == y {
        return 0;
    }
    if (x == 2 && y == 4) || (x == 4 && y == 2) {
        return 0;
    }

    if x <= 3 && y <= 3 {
        return if x < y { -1 } else { 1 };
    }
    if x >= 3 && y >= 3 {
        return if x < y { 1 } else { -1 };
    }

    if x == 1 {
        return -1;
    }
    if y == 1 {
        return -1;
    }

    if x <= 3 { 1 } else { -1 }
}

fn main() {
    let stdin = io::stdin();
    let mut input = String::new();
    stdin.lock().read_line(&mut input).unwrap();

    let tokens: Vec<&str> = input.split_whitespace().collect();
    let x = tokens[0].parse::<i32>().unwrap();
    let y = tokens[1].parse::<i32>().unwrap();

    match compare(x, y) {
        -1 => println!("<"),
         0 => println!("="),
         1 => println!(">"),
         _ => println!("This shouldn't happen...")
    };
}


Alice and Bob are playing a game with $$$n$$$ piles of stones. It is guaranteed that $$$n$$$ is an even number. The $$$i$$$-th pile has $$$a_i$$$ stones.Alice and Bob will play a game alternating turns with Alice going first.On a player's turn, they must choose exactly $$$\frac{n}{2}$$$ nonempty piles and independently remove a positive number of stones from each of the chosen piles. They can remove a different number of stones from the piles in a single turn. The first player unable to make a move loses (when there are less than $$$\frac{n}{2}$$$ nonempty piles).Given the starting configuration, determine who will win the game.

The first line contains one integer $$$n$$$ ($$$2 \leq n \leq 50$$$) — the number of piles. It is guaranteed that $$$n$$$ is an even number. The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \leq a_i \leq 50$$$) — the number of stones in the piles.

Print a single string "Alice" if Alice wins; otherwise, print "Bob" (without double quotes).

NoteIn the first example, each player can only remove stones from one pile ($$$\frac{2}{2}=1$$$). Alice loses, since Bob can copy whatever Alice does on the other pile, so Alice will run out of moves first.In the second example, Alice can remove $$$2$$$ stones from the first pile and $$$3$$$ stones from the third pile on her first move to guarantee a win.

//spnauti-rusT {{{
use std::io::*; use std::str::{self,*}; use std::fmt::Debug;
#[allow(unused_imports)] use std::cmp::Ordering::{self,*};
#[allow(unused_imports)] use std::ops::{self,*};
#[allow(unused_imports)] use std::iter::{self,*};
#[allow(unused_imports)] use std::collections::*;
#[allow(unused_imports)] use std::cell::*;
#[allow(unused_macros)] macro_rules! min {
	($x:expr,$y:expr) => {{ let b=$y; let a=&mut$x; if b < *a {*a=b; true} else {false} }};
}
#[allow(unused_macros)] macro_rules! max {
	($x:expr,$y:expr) => {{ let b=$y; let a=&mut$x; if b > *a {*a=b; true} else {false} }};
}
#[allow(unused_macros)] macro_rules! l {
	($($v:ident),+ =$e:expr) => {$(let$v=$e;)+};
	($($v:ident),+:$t:ty=$e:expr) => {$(let$v:$t=$e;)+};
	(mut $($v:ident),+ =$e:expr) => {$(let mut$v=$e;)+};
	(mut $($v:ident),+:$t:ty=$e:expr) => {$(let mut$v:$t=$e;)+};
}
#[allow(unused_macros)] macro_rules! v {
	([$d:expr]$($s:tt)+) => {vec![v!($($s)+);$d]};
	([]) => {Vec::new()}; ([$e:expr]) => {Vec::with_capacity($e)}; (=$e:expr) => {$e};
}
#[allow(unused_macros)] macro_rules! rep { {[$c:expr]$($s:tt)+} => {for _ in 0..$c {$($s)+}} }
#[allow(dead_code)] fn reader() -> WordReaderC { WordReaderC::new() }
#[allow(dead_code)] fn writer() -> BufWriter<Stdout> { BufWriter::new(stdout()) }
struct WordReaderC {buf: Vec<u8>, pos: usize, q: std::io::StdinLock<'static>}//'
#[allow(dead_code)] impl WordReaderC {
	fn new() -> Self {
		let r = unsafe {&*Box::into_raw(Box::new(stdin()))};
		Self { q: r.lock(), buf: Vec::new(), pos: 0 }
	}
	fn next_line(&mut self) -> bool {
		self.buf.clear(); self.pos = 0;
		self.q.read_until(b'\n', &mut self.buf).unwrap_or(0) > 0
	}
	fn is_ws(c: u8) -> bool {
		c == b' ' || c == b'\r' || c == b'\n' || c == b'\t'
	}
	fn byte(&mut self) -> Option<u8> {
		if self.pos == self.buf.len() { if !self.next_line() { return None; } }
		self.pos += 1; Some(self.buf[self.pos - 1])
	}
	fn vb(&mut self) -> Vec<u8> {
		let mut s = Vec::with_capacity(8);
		let mut f = false;
		loop {
			if let Some(c) = self.byte() {
				if !Self::is_ws(c) {
					s.push(c);
					f = true;
				} else if f { break; }
			} else { break; }
		}
		s
	}
	fn s(&mut self) -> String { String::from_utf8(self.vb()).expect("invalid utf8") }
	fn i(&mut self) ->    i32 { self.p() }
	fn l(&mut self) ->    i64 { self.p() }
	fn u(&mut self) ->  usize { self.p() }
	fn f(&mut self) ->    f64 { self.p() }
	fn vi(&mut self, n: usize) -> Vec<i32> { self.vp(n) }
	fn vl(&mut self, n: usize) -> Vec<i64> { self.vp(n) }
	fn vu(&mut self, n: usize) -> Vec<usize> { self.vp(n) }
	fn ii(&mut self, n: usize) -> impl Iterator<Item=i32> { self.ip(n).into_iter() }
	fn iu(&mut self, n: usize) -> impl Iterator<Item=usize> { self.ip(n).into_iter() }
	fn p<T: FromStr>(&mut self) -> T where T::Err: Debug {
		let w = self.vb(); str::from_utf8(w.as_ref()).unwrap().parse::<T>().unwrap()
	}
	fn vp<T: FromStr>(&mut self, n: usize) -> Vec<T> where T::Err: Debug {
		(0..n).map(|_|self.p()).collect()
	}
	fn ip<T: FromStr>(&mut self, n: usize) -> impl Iterator<Item=T> where T::Err: Debug {
		self.vp(n).into_iter()
	}
}
//------------------- End rusT }}}

fn main() {
	let mut rin = reader();
	let mut rout = writer();

	let n = rin.u();
	let mut a = rin.vi(n);
	a.sort();
	let mut c = 0;
	while c < n && a[0] == a[c] {
		c += 1;
	}
	if c <= n/2 {
		writeln!(rout, "Alice").ok();
	} else {
		writeln!(rout, "Bob").ok();
	}
}

//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//

fn run() {
    input! {
        n: usize,
        a: [usize; n],
    }
    let mut a = a;
    a.sort();
    let ans = if a[0] == a[n / 2] {
        "Bob"
    } else {
        "Alice"
    };
    println!("{}", ans);
}

fn main() {
    run();
}

#![allow(unused_variables)]
#![allow(unused_must_use)]
#![allow(dead_code)]
use std::io::{self, prelude::*};

fn solve<R: BufRead, W: Write>(mut input: FastInput<R>, mut w: W) {
    let n: usize = input.token();
    let mut a = vec![0usize; n];
    for x in a.iter_mut() {
        *x = input.token();
    }
    let min = a.iter().min().unwrap();
    let cnt = a.iter().filter(|&x| x == min).count();
    if cnt > n / 2 {
        write!(w, "Bob\n");
    } else {
        write!(w, "Alice\n");
    }
}

fn main() {
    let stdin = io::stdin();
    let stdout = io::stdout();
    let input = FastInput::from(stdin.lock());
    let writer = io::BufWriter::new(stdout.lock());
    solve(input, writer);
}

trait TokenStream<T> {
    fn token(&mut self) -> T;
}

struct FastInput<R> {
    stdin: R,
    pos: usize,
}

impl<R: BufRead> From<R> for FastInput<R> {
    fn from(r: R) -> Self {
        FastInput { stdin: r, pos: 0 }
    }
}

impl<R: BufRead> TokenStream<u8> for FastInput<R> {
    fn token(&mut self) -> u8 {
        loop {
            if let Ok(buf) = self.stdin.fill_buf() {
                while self.pos < buf.len() {
                    self.pos += 1;
                    if buf[self.pos - 1] > 32 {
                        return buf[self.pos - 1];
                    }
                }
                if self.pos == 0 {
                    return 0;
                }
            } else {
                return 0;
            }
            self.stdin.consume(self.pos);
            self.pos = 0;
        }
    }
}

impl<R: BufRead> TokenStream<Vec<u8>> for FastInput<R> {
    fn token(&mut self) -> Vec<u8> {
        let mut ans = Vec::new();
        let mut parse_token = false;
        loop {
            if let Ok(buf) = self.stdin.fill_buf() {
                if !parse_token {
                    while self.pos < buf.len() && buf[self.pos] <= 32 {
                        self.pos += 1;
                    }
                }
                while self.pos < buf.len() && buf[self.pos] > 32 {
                    parse_token = true;
                    ans.push(buf[self.pos]);
                    self.pos += 1;
                }
                if self.pos != buf.len() || self.pos == 0 {
                    return ans;
                }
            }
            self.stdin.consume(self.pos);
            self.pos = 0;
        }
    }
}

macro_rules! impl_token_stream_u {
    ($($t:ident),+) => {$(
        impl<R: BufRead> TokenStream<$t> for FastInput<R> {
           fn token(&mut self) -> $t {
                let mut ans = 0;
                let mut parse_token = false;
                loop {
                    if let Ok(buf) = self.stdin.fill_buf() {
                        if !parse_token {
                            while self.pos < buf.len() && buf[self.pos] <= 32 {
                                self.pos += 1;
                            }
                        }
                        while self.pos < buf.len() && buf[self.pos] > 32 {
                            parse_token = true;
                            ans = ans * 10 + (buf[self.pos] - b'0') as $t;
                            self.pos += 1;
                        }
                        if self.pos != buf.len() || self.pos == 0 {
                            return ans;
                        }
                    }
                    self.stdin.consume(self.pos);
                    self.pos = 0;
                }
           }
        }
    )+}
}

pub trait Identity {
    fn identity() -> Self;
}

pub trait SelfIdentity {
    fn self_identity(&self) -> Self;
}

impl<T: Identity> SelfIdentity for T {
    fn self_identity(&self) -> Self {
        Self::identity()
    }
}

pub trait Inverse {
    fn inverse(self) -> Self;
}

macro_rules! define_modular_type {
    ($mod:ident, $value:expr) => {
        #[derive(Copy, Clone, Default, PartialEq)]
        struct $mod(u32);

        impl $mod {
            const MOD: u64 = $value;
        }

        impl std::fmt::Debug for $mod {
            fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
                write!(f, "{:?}", self.0)
            }
        }

        impl std::fmt::Display for $mod {
            fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
                write!(f, "{}", self.0)
            }
        }

        impl<T: Into<u64>> From<T> for $mod {
            fn from(a: T) -> Self {
                $mod((a.into() % Self::MOD) as u32)
            }
        }

        impl Into<u32> for $mod {
            fn into(self) -> u32 {
                self.0
            }
        }

        impl Identity for $mod {
            fn identity() -> Self {
                1u32.into()
            }
        }

        impl Inverse for $mod {
            fn inverse(self) -> Self {
                let mut t = (Self::default(), Self::identity());
                let mut r = (Self::MOD, self.0 as u64);
                while r.1 != 0 {
                    let q = r.0 / r.1;
                    t = (t.1, t.0 - t.1 * q.into());
                    r = (r.1, r.0 - r.1 * q);
                }
                t.0
            }
        }

        impl std::ops::Add for $mod {
            type Output = $mod;
            fn add(self, rhs: $mod) -> Self::Output {
                let mut ret = self.0 + rhs.0;
                if ret >= Self::MOD as u32 {
                    ret -= Self::MOD as u32;
                }
                $mod(ret)
            }
        }

        impl std::ops::AddAssign for $mod {
            fn add_assign(&mut self, rhs: Self) {
                self.0 += rhs.0;
                if self.0 >= Self::MOD as u32 {
                    self.0 -= Self::MOD as u32;
                }
            }
        }

        impl std::ops::Neg for $mod {
            type Output = Self;
            fn neg(self) -> Self::Output {
                $mod(Self::MOD as u32 - self.0)
            }
        }

        impl std::ops::Sub for $mod {
            type Output = $mod;
            fn sub(self, rhs: Self) -> Self::Output {
                if self.0 < rhs.0 {
                    $mod(self.0 + (Self::MOD as u32) - rhs.0)
                } else {
                    $mod(self.0 - rhs.0)
                }
            }
        }

        impl std::ops::SubAssign for $mod {
            fn sub_assign(&mut self, rhs: Self) {
                if self.0 < rhs.0 {
                    self.0 += Self::MOD as u32;
                }
                self.0 -= rhs.0
            }
        }

        impl std::ops::Mul for $mod {
            type Output = $mod;
            fn mul(self, rhs: Self) -> Self::Output {
                let a = self.0 as u64;
                let b = rhs.0 as u64;
                let c = a * b % Self::MOD;
                $mod(c as u32)
            }
        }

        impl std::ops::MulAssign for $mod {
            fn mul_assign(&mut self, rhs: Self) {
                *self = *self * rhs;
            }
        }

        impl std::ops::Div for $mod {
            type Output = Self;
            fn div(self, rhs: Self) -> Self::Output {
                self * rhs.inverse()
            }
        }

        impl std::ops::DivAssign for $mod {
            fn div_assign(&mut self, rhs: Self) {
                *self = *self / rhs;
            }
        }
    };
}

#[derive(Clone)]
pub struct Matrix<T> {
    data: Vec<T>,
    cols: usize,
    rows: usize,
}

impl<T> Matrix<T>
where
    T: std::default::Default + Clone,
{
    pub fn new(rows: usize, cols: usize) -> Matrix<T> {
        let data = vec![T::default(); cols * rows];
        Matrix {
            data: data,
            cols: cols,
            rows: rows,
        }
    }
}

impl<T> Matrix<T> {
    pub fn rows(&self) -> std::slice::Chunks<T> {
        self.data.chunks(self.cols)
    }
    pub fn rows_mut(&mut self) -> std::slice::ChunksMut<T> {
        self.data.chunks_mut(self.cols)
    }
    pub fn elem(&self, row: usize, col: usize) -> &T {
        &self.data[self.cols * row + col]
    }
    pub fn elem_mut(&mut self, row: usize, col: usize) -> &mut T {
        &mut self.data[self.cols * row + col]
    }
}

impl<T> std::fmt::Debug for Matrix<T>
where
    T: std::fmt::Debug,
{
    fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
        self.rows()
            .try_for_each(|row| fmt.write_fmt(format_args!("{:?}\n", row)))
    }
}

impl<T> SelfIdentity for Matrix<T>
where
    T: Identity + std::default::Default + Clone,
{
    fn self_identity(&self) -> Self {
        assert_eq!(self.cols, self.rows);
        let mut ret = Matrix::new(self.rows, self.cols);
        for (i, row) in ret.rows_mut().enumerate() {
            row[i] = T::identity();
        }
        ret
    }
}

impl<T> std::ops::Add for Matrix<T>
where
    T: Clone + std::default::Default + std::ops::Add<Output = T>,
{
    type Output = Matrix<T>;
    fn add(self, rhs: Matrix<T>) -> Matrix<T> {
        assert_eq!(self.cols, rhs.cols);
        assert_eq!(self.rows, rhs.rows);
        Matrix {
            data: self
                .data
                .iter()
                .zip(rhs.data)
                .map(|(a, b)| a.clone() + b.clone())
                .collect(),
            rows: self.rows,
            cols: self.cols,
        }
    }
}
impl<T> std::ops::Sub for Matrix<T>
where
    T: Clone + std::default::Default + std::ops::Sub<Output = T>,
{
    type Output = Matrix<T>;
    fn sub(self, rhs: Matrix<T>) -> Matrix<T> {
        assert_eq!(self.cols, rhs.cols);
        assert_eq!(self.rows, rhs.rows);
        Matrix {
            data: self
                .data
                .iter()
                .zip(rhs.data)
                .map(|(a, b)| a.clone() - b.clone())
                .collect(),
            rows: self.rows,
            cols: self.cols,
        }
    }
}
impl<T> std::ops::Mul for Matrix<T>
where
    T: Clone + std::default::Default + std::ops::AddAssign + std::ops::Mul<Output = T>,
{
    type Output = Matrix<T>;
    fn mul(self, rhs: Matrix<T>) -> Matrix<T> {
        assert_eq!(self.cols, rhs.rows);
        let mut ret: Matrix<T> = Matrix::new(self.rows, rhs.cols);
        for (ret_row, self_row) in ret.rows_mut().zip(self.rows()) {
            for (rhs_row, self_el) in rhs.rows().zip(self_row) {
                for (ret_el, rhs_el) in ret_row.iter_mut().zip(rhs_row) {
                    *ret_el += self_el.clone() * rhs_el.clone();
                }
            }
        }
        ret
    }
}

fn binary_power<T>(a: &T, mut exp: u64) -> T
where
    T: Clone + std::ops::Mul<Output = T> + SelfIdentity,
{
    let mut base = a.clone();
    let mut acc = a.self_identity();
    while exp > 1 {
        if (exp & 1) == 1 {
            acc = acc * base.clone();
        }
        exp /= 2;
        base = base.clone() * base.clone();
    }
    if exp == 1 {
        acc = acc * base;
    }
    acc
}

impl_token_stream_u!(usize);
define_modular_type!(MOD7, 1_000_000_007);

#[allow(unused_imports)]
use std::cmp::{min,max};
//const INF: i32 = 0x3f3f3f3f;

struct Scanner {
    buffer: std::collections::VecDeque<String>
}

impl Scanner {
    fn new() -> Scanner {
        Scanner {
            buffer: std::collections::VecDeque::new()
        }
    }

    fn next<T: std::str::FromStr>(&mut self) -> T {
        while self.buffer.is_empty() {
            let mut input = String::new();
            std::io::stdin().read_line(&mut input).ok();
            self.buffer = input.split_whitespace()
                .map(ToString::to_string).collect();
        }
        let front = self.buffer.pop_front().unwrap();
        front.parse::<T>().ok().unwrap()
    }
}

fn main1() {
    let mut scan = Scanner::new();
    let n = scan.next::<usize>();

    let mut lo = 99;
    let mut rep = 0;
    for _ in 0..n {
        let a = scan.next::<usize>();
        if lo > a {
            lo = a;
            rep = 0;
        }
        if lo == a {
            rep += 1;
        }
    }
    if rep <= n / 2 {
        println!("Alice");
    } else {
        println!("Bob");
    }
}

fn main() {
    std::thread::Builder::new().stack_size(50 << 20)
        .spawn(main1).unwrap().join().unwrap();
}

//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//

fn run() {
    input! {
        n: usize,
        a: [usize; n],
    }
    let mut cnt = vec![0; 10];
    for a in a {
        for i in 0..10 {
            cnt[i] += (a >> i) & 1;
        }
    }
    for i in 0..10 {
        if cnt[i] % (n / 2) != 0 {
            println!("Alice");
            return;
        }
    }
    println!("Bob");
}

fn main() {
    run();
}