#[warn(unused_variables)]

fn main() {
    let n = input_::<u64>();
    println!("{}", if n % 2 == 0 {n} else {0})
}

fn input_str() -> String {
    let mut buff = String::new();
    std::io::stdin().read_line(&mut buff).expect("Err");
    buff
}

fn input_<T>() -> T
where
    T: std::str::FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    input_str().trim().parse::<T>().expect("Err pars")
}

fn input_vec<T>(sep: &str) -> Vec<T>
where
    T: std::str::FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    input_str().trim().split(sep).map(|c| c.parse::<T>().expect("Err pars")).collect()
}

fn input_vec_chars() -> Vec<char> {
    input_str().trim().chars().collect()
}


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: u32 = scan.next();
    if n < 2 {
        println!("0");
    } else {
        println!("{}", 2u64.pow(n / 2));
    }
}

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


use std::io;

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(),
            )+
        )
    }}
}

fn next_index(len: usize, curr: usize, go_left: bool) -> Option<usize> {
    if len % 2 == 0 {
        if go_left {
            if len >= curr + 1 {
                Some(len - curr - 1)
            } else {
                None
            }
        } else {
            if len >= curr + 2 {
                Some(len - curr - 2)
            } else {
                None
            }
        }
    } else {
        if go_left {
            if len >= curr + 1 {
                Some(len - curr - 1)
            } else {
                None
            }
        } else {
            if len >= curr {
                Some(len - curr)
            } else {
                None
            }
        }
    }
}

fn main() {
    let message = readln!();
    let message = message.chars().collect::<Vec<_>>();

    if message.len() == 1 {
        println!("z");
        return;
    }

    let mut index = (message.len() - 1) / 2;
    let mut go_left = true;
    loop {
        print!("{}", message[index]);

        match next_index(message.len(), index, go_left) {
            None => break,
            Some(new_index) => index = new_index
        };
        go_left = !go_left;
    }
    println!();
}


use std::io;

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(),
            )+
        )
    }}
}

fn next_index(len: usize, curr: usize, go_left: bool) -> Option<usize> {
    if len % 2 == 0 {
        if go_left {
            if len >= curr + 1 {
                Some(len - curr - 1)
            } else {
                None
            }
        } else {
            if len >= curr + 2 {
                Some(len - curr - 2)
            } else {
                None
            }
        }
    } else {
        if go_left {
            if len >= curr + 1 {
                Some(len - curr - 1)
            } else {
                None
            }
        } else {
            if len >= curr && len - curr < len {
                Some(len - curr)
            } else {
                None
            }
        }
    }
}

fn main() {
    let message = readln!();
    let message = message.chars().collect::<Vec<_>>();

    if message.len() == 1 {
        println!("z");
        return;
    }

    let mut index = (message.len() - 1) / 2;
    let mut go_left = true;
    loop {
        print!("{}", message[index]);

        match next_index(message.len(), index, go_left) {
            None => break,
            Some(new_index) => index = new_index
        };
        go_left = !go_left;
    }
    println!();
}


#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_imports)]
use std::io::stdin;

mod util {
    use std::io::stdin;
    use std::str::FromStr;
    use std::fmt::Debug;

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

    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }
}

#[allow(unused_macros)]
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    get!($t)
                   ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    get!($($t),*)
                   ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

// https://github.com/bluss/permutohedron
pub trait LexicalPermutation {
    /// Return `true` if the slice was permuted, `false` if it is already
    /// at the last ordered permutation.
    fn next_permutation(&mut self) -> bool;
    /// Return `true` if the slice was permuted, `false` if it is already
    /// at the first ordered permutation.
    fn prev_permutation(&mut self) -> bool;
}

impl<T> LexicalPermutation for [T]
where
    T: Ord,
{
    /// Original author in Rust: Thomas Backman <serenity@exscape.org>
    fn next_permutation(&mut self) -> bool {
        // These cases only have 1 permutation each, so we can't do anything.
        if self.len() < 2 {
            return false;
        }

        // Step 1: Identify the longest, rightmost weakly decreasing part of the vector
        let mut i = self.len() - 1;
        while i > 0 && self[i - 1] >= self[i] {
            i -= 1;
        }

        // If that is the entire vector, this is the last-ordered permutation.
        if i == 0 {
            return false;
        }

        // Step 2: Find the rightmost element larger than the pivot (i-1)
        let mut j = self.len() - 1;
        while j >= i && self[j] <= self[i - 1] {
            j -= 1;
        }

        // Step 3: Swap that element with the pivot
        self.swap(j, i - 1);

        // Step 4: Reverse the (previously) weakly decreasing part
        self[i..].reverse();

        true
    }

    fn prev_permutation(&mut self) -> bool {
        // These cases only have 1 permutation each, so we can't do anything.
        if self.len() < 2 {
            return false;
        }

        // Step 1: Identify the longest, rightmost weakly increasing part of the vector
        let mut i = self.len() - 1;
        while i > 0 && self[i - 1] <= self[i] {
            i -= 1;
        }

        // If that is the entire vector, this is the first-ordered permutation.
        if i == 0 {
            return false;
        }

        // Step 2: Reverse the weakly increasing part
        self[i..].reverse();

        // Step 3: Find the rightmost element equal to or bigger than the pivot (i-1)
        let mut j = self.len() - 1;
        while j >= i && self[j - 1] < self[i - 1] {
            j -= 1;
        }

        // Step 4: Swap that element with the pivot
        self.swap(i - 1, j);

        true
    }
}

fn main() {
    let mut v = get!(usize;;);

    v.sort();

    if v[0] == 1 {
        println!("YES");
        return;
    }

    while {
        let a = v[0];
        let b = v[1];
        let c = v[2];

        let t0 = 0;
        let t1 = 1;

        let mut t2 = 0;

        for t in 2..2000 {
            if !((t - t0) % a == 0 || (t - t1) % b == 0) {
                t2 = t;
            }
        }

        if (0..2000).all(|t| {
            (t >= t0 && (t - t0) % a == 0) || (t >= t1 && (t - t1) % b == 0)
                || (t >= t2 && (t - t2) % c == 0)
        }) {
            println!("YES");
            return;
        }

        v.next_permutation()
    } {}

    println!("NO");
}


use std::io;

fn main() {
    let ios = io::stdin(); // create stdin instance
    let mut inp : String = String::new(); // initialize mutable temporary variable >.<
    ios.read_line(&mut inp); // pass mutable reference to readline

    // read multiple numbers
    let inps : Vec<i32> = inp.trim().split(" ").map(|x| x.parse().expect("wo")).collect(); // this is ruby like syntax

    let n = inps[0];
    let m = inps[1];
    let a = inps[2];

    // need string literals to print numbers
    println!("{}", ceil(n, a) * ceil(m, a));
}

fn ceil(x: i32, y: i32) -> i32 {
    if x % y == 0 { x / y } else { x / y + 1 }
}


#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(overflowing_literals)]
#![allow(unused_must_use)]
#![allow(non_camel_case_types)]

use std::collections::*;
use std::io::*;
use std::cmp::{max, min, Ordering};
use std::f64::consts::*;
use std::mem::{swap, size_of_val, size_of};
use std::fs::File;
use std::rc::*;
use std::ascii::*;
use std::ops::*;
use std::num::*;
use std::process::*;
//use std::ptr::*;
use std::iter::{once, repeat};

const INF: i32 = std::i32::MAX;
const LINF: i64 = std::i64::MAX;
const MOD: usize = 1000000007;

struct Input<Buf: BufRead> {
	buffer: Buf,
}

impl<Buf: BufRead> Input<Buf> {
	fn read_char(&mut self) -> char {
		let mut x = [255u8];
		self.buffer.read(&mut x).expect("EOF");
		x[0] as char
	}
	fn read_line(&mut self) -> String {
		let mut v = Vec::new();
		let mut x = [255u8];
		self.buffer.read(&mut x).expect("EOF");
		while x[0] < b' ' && x[0] != 255u8 {
			x[0] = 255u8;
			self.buffer.read(&mut x).expect("EOF");
		}
		while x[0] >= b' ' && x[0] != 255u8 {
			v.push(x[0]);
			x[0] = 255u8;
			self.buffer.read(&mut x).expect("EOF");
		}
		String::from_utf8(v).unwrap()
	}

	fn read_word(&mut self) -> String {
		let mut v = Vec::new();
		let mut x = [255u8];
		self.buffer.read(&mut x).expect("EOF");
		while x[0] <= b' ' && x[0] != 255u8 {
			x[0] = 255u8;
			self.buffer.read(&mut x).expect("EOF");
		}
		while x[0] > b' ' && x[0] != 255u8 {
			v.push(x[0]);
			x[0] = 255u8;
			self.buffer.read(&mut x).expect("EOF");
		}
		String::from_utf8(v).unwrap()
	}
}

macro_rules! read {
    () => {};
	($inf:ident, $t:ty) => ($inf.read_word().parse::<$t>().expect("Parsing error"));
	($inf:ident, $($t:ty),*) => (($($inf.read_word().parse::<$t>().expect("Parsing error")),*));
}
fn gcd<T>(mut a: T, mut b: T) -> T
	where T: ShrAssign + BitAnd<Output=T> + Ord + From<u8> + Clone + SubAssign + ShlAssign<usize> + Copy
{
	let one = T::from(1);
	let zero = T::from(0);
	let mut ans = 0;
	if a < b {
		swap(&mut a, &mut b);
	}
	while b > zero {
		if (a & one > zero) && (b & one > zero) {
			a -= b;
		} else if a & one > zero {
			b >>= one;
		} else if b & one > zero {
			a >>= one;
		} else {
			ans += 1;
			a >>= one;
			b >>= one;
		}
		if a < b {
			swap(&mut a, &mut b);
		}
	}
	a <<= ans;
	a
}

fn powmod<X, Y>(mut base: X, mut exp: Y, mm: X) -> X
	where X: Copy + Clone + Mul<Output=X> + Rem<Output=X> + From<u8>,
	      Y: ShrAssign + Copy + Clone + BitAnd<Output=Y> + From<u8> + Ord
{
	let mut res = X::from(1);
	while exp > Y::from(0) {
		if exp & Y::from(1) > Y::from(0) {
			res = res * base % mm;
		}
		base = base * base % mm;
		exp >>= Y::from(1);
	}
	res
}

fn main() {
	match std::env::var("home") {
		Ok(_x) => {
			let mut inf = Input { buffer: BufReader::new(File::open("input.txt").expect("File not found")) };
			let stdout = stdout();
			let ostr = stdout.lock();
			let mut ouf = BufWriter::new(ostr);
			solve(&mut inf, &mut ouf);
		}
		Err(_e) => {
			let stdin = stdin();
			let istr = stdin.lock();
			let mut inf = Input { buffer: BufReader::new(istr) };
			let stdout = stdout();
			let ostr = stdout.lock();
			let mut ouf = BufWriter::new(ostr);
			solve(&mut inf, &mut ouf);
		}
	}
}

fn solve<Inner: BufRead, Output: Write>(inf: &mut Input<Inner>, ouf: &mut Output) {
	let (n, d) = read!(inf,usize,i32);
	let mut a = vec![0; n];
	for i in 0..n {
		a[i] = read!(inf,i32);
	}
	a.sort_unstable();
	let (mut p1, mut p2) = (0, n - 1);
	while p2 > 0 && a[p2] - a[0] > d {
		p2 -= 1;
	}
	while p1 < n - 1 && a[n - 1] - a[p1] > d {
		p1 += 1;
	}
	writeln!(ouf, "{}", min(p1, n - 1 - p2));
}


use std::io;

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

    try!(io::stdin().read_line(&mut input_str));

    Ok(input_str)
}

fn a_to_b(a: u32, b: u32) -> Vec<u32> {
    let mut result = Vec::new();
    let mut current_state = b;

    loop {
        match current_state {
            x if x < a || x % 2 != 0 && x % 10 != 1 => {
                result.clear();
                break;
            }
            x => {
                result.push(x);
                match x {
                    x if x == a => break,
                    x if x % 2 == 0 => current_state /= 2,
                    _ => current_state /= 10,
                }
            }
        }
    }

    result.reverse();
    result
}

fn main() {
    let input_line = read_line().expect("Failed to read line.");
    let mut input_line_iter = input_line.split_whitespace();

    let given_number = input_line_iter.next()
        .expect("First number is not given.")
        .parse::<u32>()
        .expect("First number is invalid.");
    let result_number = input_line_iter.next()
        .expect("Second number is not given.")
        .parse::<u32>()
        .expect("Second number is invalid");

    let answer_sequence = a_to_b(given_number, result_number);

    match answer_sequence.len() {
        0 => println!("NO"),
        len => {
            println!("YES\n{}", len);
            for number in answer_sequence {
                print!("{} ", number);
            }
        }
    }
}


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

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

    fn next_line(&self) -> String {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).expect("Fail to read");
        line
    }

    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 line = self.next_line();
            self.buffer = line.split_whitespace().map(String::from).collect();
        }
    }

    fn next_n<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.next()).collect()
    }
}

fn _main() {
    let mut scan = Scan::new();
    let mut c = [0usize; 3];
    for s in scan.next::<String>().chars() {
        match s {
            'B' => {
                c[0] += 1;
            }
            'S' => {
                c[1] += 1;
            }
            'C' => {
                c[2] += 1;
            }
            _ => {}
        }
    }
    let mut n: Vec<usize> = scan.next_n(3);
    let p: Vec<usize> = scan.next_n(3);
    let mut r: u64 = scan.next();
    let unit_price = (c[0] * p[0] + c[1] * p[1] + c[2] * p[2]) as u64;
    let mut result = 0u64;
    loop {
        if !n.iter().all(|x| *x == 0) {
            for i in 0..3 {
                if c[i] > n[i] && r >= ((c[i] - n[i]) * p[i]) as u64 {
                    r -= ((c[i] - n[i]) * p[i]) as u64;
                    n[i] = c[i];
                }
            }
        } else {
            break;
        }
        let mut buying = std::usize::MAX;
        for i in 0..3 {
            if c[i] != 0 {
                buying = buying.min(n[i] / c[i]);
            }
        }
        if buying == 0 {
            break;
        }
        for i in 0..3 {
            n[i] -= buying * c[i];
        }
        result += buying as u64;
    }
    result += r / unit_price;
    println!("{}", result);
}

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


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

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

    fn next_line(&self) -> String {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).expect("Fail to read");
        line
    }

    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 line = self.next_line();
            self.buffer = line.split_whitespace().map(String::from).collect();
        }
    }

    fn next_n<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.next()).collect()
    }
}

fn _main() {
    let mut scan = Scan::new();
    let mut c = [0u64; 3];
    for s in scan.next::<String>().chars() {
        match s {
            'B' => {
                c[0] += 1;
            }
            'S' => {
                c[1] += 1;
            }
            'C' => {
                c[2] += 1;
            }
            _ => {}
        }
    }
    let n: Vec<u64> = scan.next_n(3);
    let p: Vec<u64> = scan.next_n(3);
    let r: u64 = scan.next();
    let mut low = 0u64;
    let mut high = 1000000000000u64;
    while low <= high {
        let middle = (low + high) / 2;
        let mut f = 0u64;
        for i in 0..3 {
            if c[i] * middle > n[i] {
                f += (c[i] * middle - n[i]) * p[i];
            }
        }
        if f <= r {
            low = middle + 1;
        } else {
            high = middle - 1;
        }
    }
    println!("{}", low - 1);
}

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


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 ss: Vec<u8> = parse_line!(String).bytes().collect();
    let b = ss.iter().filter(|c| **c == b'B').count() as u64;
    let s = ss.iter().filter(|c| **c == b'S').count() as u64;
    let c = ss.iter().filter(|c| **c == b'C').count() as u64;
    let (nb, ns, nc) = parse_line!(u64, u64, u64);
    let (pb, ps, pc) = parse_line!(u64, u64, u64);
    let r = parse_line!(u64);
    let mut l = 0;
    let mut u = 1000000000000;
    while u - l > 1 {
        let m = (l + u) / 2;
        let need =
            if b * m <= nb {0} else {pb * (b * m - nb)} +
            if s * m <= ns {0} else {ps * (s * m - ns)} +
            if c * m <= nc {0} else {pc * (c * m - nc)};
        if need <= r {
            l = m;
        }else{
            u = m;
        }
    }
    writeln!(writer, "{}", l).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);
    }
}


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

fn input_split() -> Vec<u8> {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.trim()
        .split_whitespace()
        .map(|elem| elem.parse().unwrap())
        .collect()
}

fn main() {
    let mut k = input();
    let mut months = input_split();
    months.sort_unstable_by(|a, b| b.cmp(&a));

    let mut count = 0;

    if k != 0 {
        for month in months {
            count += 1;
            if month >= k {
                break;
            } else {
                k -= month;
            }
        }
    }

    if count == 12 && k != 0 {
        print!("-1")
    } else {
        print!("{}", count)
    }
}


// Try Codeforces
// author: Leonardone @ NEETSDKASU

fn main() {
    let mut stdin = String::new();
    std::io::Read::read_to_string(
        &mut std::io::stdin(),
        &mut stdin).unwrap();
    let mut stdin = stdin.split_whitespace();
    let mut get = || stdin.next().unwrap();
    macro_rules! get {
        ($t:ty) => (get().parse::<$t>().unwrap());
        () => (get!(i64));
    }

    let n = get!();
    let m = get!();
    let k = get!();

    if k < n {
        println!("1 {}", k);
        return;
    }

    let e = k - n;
    let r = e / (m - 1);
    let c = e % (m - 1);

    let y = n - r;
    let x = if r % 2 == 0 { c + 1 } else { m - c };

    // println!("{} {} {}", e, r, c);
    println!("{} {}", y, x);

}


// Try Codeforces
// author: Leonardone @ NEETSDKASU

fn solve(n: i64, m: i64, k: i64) -> (i64, i64) {

    if k < n {
        return (k + 1, 1);
    }

    let e = k - n;
    let r = e / (m - 1);
    let c = e % (m - 1);

    let y = n - r;
    let x = if r % 2 == 0 { c + 2 } else { m - c };

    return (y, x);
}

fn main() {
    let mut stdin = String::new();
    std::io::Read::read_to_string(
        &mut std::io::stdin(),
        &mut stdin).unwrap();
    let mut stdin = stdin.split_whitespace();
    let mut get = || stdin.next().unwrap();
    macro_rules! get {
        ($t:ty) => (get().parse::<$t>().unwrap());
        () => (get!(i64));
    }

    let n = get!();
    let m = get!();
    let k = get!();

    if n * m < 20 {
        for e in 0..n*m {
            let (row, col) = solve(n, m, e);
            let (r, c) = brute_force(n, m, e);
            if row != r || col != c {
                println!("error {} {} {}", n, m, e);
                println!("solve {} {}", row, col);
                println!("bf    {} {}", r, c);
                panic!();
            }
        }
    }

    let (row, col) = solve(n, m, k);

    println!("{} {}", row, col);

}

fn brute_force(n: i64, m: i64, k: i64) -> (i64, i64) {
    let mut row = 1;
    let mut col = 1;
    let mut rem = k;

    if rem == 0 {
        return (row, col);
    }

    for _ in 0..n-1 {
        row += 1;
        rem -= 1;
        if rem == 0 {
            return (row, col);
        }
    }

    let mut state = 0;
    for _ in 0..rem {
        match state {
        0 => {
            col += 1;
            if col == m {
                state += 1;
            }
        },
        2 => {
            col -= 1;
            if col == 2 {
                state += 1;
            }
        },
        _ => {
            row -= 1;
            state = (state + 1) % 4;
        },
        }
    }
    return (row, col);
}


use std::io;
fn main() {
 let mut n = String::new();
 io::stdin().read_line(&mut n).expect("failed to read");
 let n :usize = n.trim().parse().expect("failed to parse");
 let counter = 0;
 if n/2520 >= 1 {
 let counter = counter + 1;
 println!("{}", counter);
 }
}


use std::io;
fn main() {
 let mut n = String::new();
 io::stdin().read_line(&mut n).expect("failed to read");
 let n :i16 = n.trim().parse().expect("failed to parse");
 let counter:i16 = n/2520;
 println!("{}", counter);
}


use std::io;

fn min(a: u32, b: u32, c: u32) -> u32 {
    if a <= b {
        if a <= c {
            a
        } else {
            c
        }
    } else {
        if b <= c {
            b
        } else {
            c
        }
    }
}

fn main() {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).expect("failed to read input");
    io::stdin().read_line(&mut buffer).expect("failed to read input");
    io::stdin().read_line(&mut buffer).expect("failed to read input");
    let mut buffer_iter = buffer.split_whitespace().map(|n| n.parse::<u32>().unwrap());
    let b = buffer_iter.next().unwrap();
    let g = buffer_iter.next().unwrap();
    let n = buffer_iter.next().unwrap();

    println!("{}", min(b, g, n) + 1);
}


use std::io::*;

fn reads<T: std::str::FromStr>(i: &mut StdinLock) -> Vec<T> {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

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

    let input: Vec<u8> = reads(sin);

    let initial_socks = input[0];
    let supply = input[1];

    let mut day_alive = initial_socks + (initial_socks / supply);

    if day_alive % supply == 0 {
        day_alive += 1;
    }

    // Does not he wash it?
    println!("{}", day_alive);
}


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_ts<T : FromStr>(stdin : &Stdin, ts : &mut Vec<T>) {
    let mut line = String::new();
    read_line(stdin, &mut line);
    let word_iter = line.split_whitespace();
    for word in word_iter {
        let x = parse_t(word);
        ts.push(x);
    }
}

fn num_days(n : u64, m : u64) -> u64 {
    let mut s = 0;
    let mut p = 1;
    loop {
        if p > n {
            break;
        } else {
            s = s + (n / p);
            p = p * m;
        }
    }
    s
}

fn main() {
    let stdin = io::stdin();
    let mut n_m : Vec<u64> = vec![];
    read_ts(&stdin, &mut n_m);
    let n = n_m[0];
    let m = n_m[1];
    println!("{}", num_days(n, m));
}


use std::mem;
use std::io;
use std::string;
use std::cmp::*;

fn load() -> Vec<i32> {
    let mut line = String::new();
    io::stdin().read_line(&mut line).expect("Failed to read line");
    let vec: Vec<&str> = line.split(" ").collect();
    let mut data : Vec<i32> = Vec::new();
    for i in vec {
        let el : i32 = i.trim().parse().unwrap();
        data.push(el);
    }
    data
}

fn main() {
    let ar = load();
    let (q,b) = (ar[0],ar[1]);
    let mut a = q;
    let mut res = a;
    while a > 0 {
        res += a/b;
        a/=b;
    }
    println!("{}", res);
}


#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, BinaryHeap};
#[allow(unused_imports)]
use std::iter::FromIterator;

mod util {
    use std::io::stdin;
    use std::str::FromStr;
    use std::fmt::Debug;

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

    #[allow(dead_code)]
    pub fn get<T: FromStr>() -> T
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    }

    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }

    #[allow(dead_code)]
    pub fn get2<T: FromStr, U: FromStr>() -> (T, U)
    where
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }

    #[allow(dead_code)]
    pub fn get3<S: FromStr, T: FromStr, U: FromStr>() -> (S, T, U)
    where
        <S as FromStr>::Err: Debug,
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }
}

#[allow(unused_macros)]
macro_rules! debug {
    ($x: expr) => {
        println!("{}: {:?}", stringify!($x), $x)
    }
}

fn main() {
    let n: usize = util::get();
    let ss: Vec<Vec<usize>> = (0..n)
        .map(|_| {
            let mut v: Vec<usize> = util::gets();
            v.sort();
            v
        })
        .collect();

    let ans = (1..)
        .take_while(|&x| if x < 10 {
            ss.iter().any(|v| v.binary_search(&x).is_ok())
        } else if x < 100 {
            let a1 = x % 10;
            let a2 = x / 10;

            let h1 = (0..ss.len())
                .filter(|&i| ss[i].binary_search(&a1).is_ok())
                .collect::<HashSet<_>>();
            let h2 = (0..ss.len())
                .filter(|&i| ss[i].binary_search(&a2).is_ok())
                .collect::<HashSet<_>>();

            (h1.len() > 1 && h2.len() > 1) || h1.difference(&h2).count() != 0 ||
                h2.difference(&h1).count() != 0

        } else {
            let perm = vec![
                vec![0, 1, 2],
                vec![0, 2, 1],
                vec![1, 0, 2],
                vec![1, 2, 0],
                vec![2, 0, 1],
                vec![2, 1, 0],
            ];

            let a1 = x % 10;
            let a2 = x / 10 % 10;
            let a3 = x / 100;
            let a = vec![a1, a2, a3];

            if n < 3 {
                false
            } else {
                perm.iter().any(|p| {
                    p.iter().zip(a.iter()).all(|(&i, &k)| {
                        ss[i].binary_search(&k).is_ok()
                    })
                })
            }

        })
        .last();

    if let Some(a) = ans {
        println!("{}", a);
    } else {
        println!("0");
    }

}


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

use std::io::prelude::*;
use std::io::BufReader;
use std::cmp::{max, min};

fn get_line() -> String {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    input
}

fn get_vec<T>() -> Vec<T>
where T: FromStr,
      <T as FromStr>::Err: std::fmt::Debug,
{
    get_line().split_whitespace().map(|k| k.parse().unwrap()).collect()
}

fn extended_euclid(a: i64, b: i64) -> (i64, i64, i64) {
    if b == 0 {
        (a, 1, 0)
    } else {
        let (d0, x0, y0) = extended_euclid(b, a % b);
        (d0, y0, x0 - a / b * y0)
    }
}

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

    let cubes: Vec<_> = BufReader::new(io::stdin()).lines()
        .map(|s| {
            let s = s.unwrap();
            let mut cube = [false; 10];
            for s in s.split_whitespace() {
                let d = s.bytes().last().unwrap();
                let d = (d - b'0') as usize;
                cube[d] = true;
            }
            cube
        }).collect();

    let perms = [
        [0, 1, 2],
        [0, 2, 1],
        [1, 0, 2],
        [1, 2, 0],
        [2, 0, 1],
        [2, 1, 0],
    ];

    let fact = |n| {
        let mut ret_val = 1;
        for i in 0..n {
            ret_val *= i + 1;
        }
        ret_val
    };

    let check = |x| {
        let x = format!("{}", x);
        for perm in perms.iter().take(fact(n)) {
            let p = x.bytes().map(|b| (b - b'0') as usize)
                .zip(perm.iter()).all(|(d, &i)| cubes[i][d]);
            if p {
                return true;
            }
        }
        false
    };

    for i in 1.. {
        if !check(i) {
            println!("{}", i - 1);
            return;
        }
    }
}


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

use std::io::prelude::*;
use std::io::BufReader;
use std::cmp::{max, min};

fn get_line() -> String {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    input
}

fn get_vec<T>() -> Vec<T>
where T: FromStr,
      <T as FromStr>::Err: std::fmt::Debug,
{
    get_line().split_whitespace().map(|k| k.parse().unwrap()).collect()
}

fn extended_euclid(a: i64, b: i64) -> (i64, i64, i64) {
    if b == 0 {
        (a, 1, 0)
    } else {
        let (d0, x0, y0) = extended_euclid(b, a % b);
        (d0, y0, x0 - a / b * y0)
    }
}

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

    let cubes: Vec<_> = BufReader::new(io::stdin()).lines()
        .map(|s| {
            let s = s.unwrap();
            let mut cube = [false; 10];
            for s in s.split_whitespace() {
                let d = s.bytes().last().unwrap();
                let d = (d - b'0') as usize;
                cube[d] = true;
            }
            cube
        }).collect();

    let perms = match n {
        3 => vec![
            vec![0, 1, 2],
            vec![0, 2, 1],
            vec![1, 0, 2],
            vec![1, 2, 0],
            vec![2, 0, 1],
            vec![2, 1, 0],
        ],
        2 => vec![
            vec![0, 1],
            vec![1, 0],
        ],
        1 => vec![vec![1]],
        _ => panic!(""),
    };

    let fact = |n| {
        let mut ret_val = 1;
        for i in 0..n {
            ret_val *= i + 1;
        }
        ret_val
    };

    let check = |x| {
        let x = format!("{}", x);
        for perm in perms.iter().take(fact(n)) {
            let p = x.bytes().map(|b| (b - b'0') as usize)
                .zip(perm.iter()).all(|(d, &i)| cubes[i][d]);
            if p {
                return true;
            }
        }
        false
    };

    for i in 1.. {
        if !check(i) {
            println!("{}", i - 1);
            return;
        }
    }
}


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

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

    fn next_line(&self) -> String {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).expect("Fail to read");
        line
    }

    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 line = self.next_line();
            self.buffer = line.split_whitespace().map(String::from).collect();
        }
    }
}

static BIG: i64 = 1e9 as i64 + 7;
fn _main() {
    let mut scan = Scan::new();
    let mut x: i64 = scan.next();
    let mut y: i64 = scan.next();
    if x < 0 {
        x += BIG;
    }
    if y < 0 {
        y += BIG;
    }
    let n: i64 = scan.next();
    for _ in 3..=n {
        let tmp = y;
        y = (y - x) % BIG;
        if y < 0 {
            y += BIG;
        }
        x = tmp;
    }
    println!("{}", y);
}

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


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

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

    fn next_line(&self) -> String {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).expect("Fail to read");
        line
    }

    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 line = self.next_line();
            self.buffer = line.split_whitespace().map(String::from).collect();
        }
    }
}

static BIG: i64 = 1e9 as i64 + 7;
fn _main() {
    let mut scan = Scan::new();
    let mut x: i64 = scan.next();
    let mut y: i64 = scan.next();
    let mut n: i64 = scan.next();
    let mut i = 2i64;
    n = n % 6;
    while i < n + 6 {
        let tmp = y;
        y = y - x;
        x = tmp;
        i += 1;
    }
    println!("{}", (y + BIG) % BIG);
}

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: u32 = read_line().parse().unwrap();

    let count: u64 = (1..n+1).map(|x| x.to_string().len() as u64).sum();

    println!("{}", count);

}


use std::io;
use std::collections::BTreeSet;

fn max(x: &BTreeSet<i32>, y: &BTreeSet<i32>) -> (BTreeSet<i32>, BTreeSet<i32>) {
    let mut r: BTreeSet<i32> = BTreeSet::new();
    let mut rx: BTreeSet<i32> = BTreeSet::new();
    let mut xiter = x.iter();
    let mut yiter = y.iter();
    let mut i: i32 = *xiter.next().unwrap();
    let mut j: i32 = *yiter.next().unwrap();
    if i < j {
        while i < j { match xiter.next() {
            Some(x) => i = *x,
            None => { i = -1; break }
        } }
    } else {
        if j < i {
            while j < i { match yiter.next() {
                Some(x) => j = *x,
                None => { j = -1; break }
            } }
        }
    }
    if i != -1 { r.insert(i); }
    if j != -1 { r.insert(j); rx.insert(j); }
    for x in xiter { r.insert(*x); }
    for y in yiter { r.insert(*y); rx.insert(*y); }
    (r, rx)
}

fn main() {
    let mut l = String::new();
    io::stdin().read_line(&mut l).unwrap();
    let x: Vec<i32> = l.split_whitespace().map(|x| x.parse().unwrap()).collect();
    let (_, k) = (x[0], x[1]);
    let mut xs = String::new();
    io::stdin().read_line(&mut xs).unwrap();
    let mut r: BTreeSet<i32> = BTreeSet::new();
    r.insert(-1);
    for x in xs.split('Y') {
        let mut rr: BTreeSet<i32> = BTreeSet::new();
        let mut rc: BTreeSet<i32> = BTreeSet::new();
        rr.insert(-1);
        rc.insert(-1);
        for g in x.split('?') {
            let mut rs: BTreeSet<i32> = BTreeSet::new();
            let gl = g.len() as i32;
            rs.insert(gl);
            let (u, ux) = max(&rr, &rs);
            rr = &u | &(rc.iter().map(|x| x + gl + 1).collect());
            rc = &ux | &(rc.iter().map(|x| x + gl + 1).collect());
        }
        r = max(&r, &rr).0;
    }
    if r.contains(&k) {
        println!("YES");
    } else {
        println!("NO");
    }
}


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

use std::cmp::max;

fn get_line() -> String {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    input
}

fn get_vec<T>(s: String) -> Vec<T>
    where T: FromStr,
          <T as FromStr>::Err: std::fmt::Debug,
{
    s.split_whitespace().map(|k| k.parse().unwrap()).collect()
}

fn main() {
    let (l, r, x, y, k) = {
        let input = get_line();
        let mut it = input.split_whitespace().map(|k| k.parse::<u32>().unwrap());
        (
            it.next().unwrap(),
            it.next().unwrap(),
            it.next().unwrap(),
            it.next().unwrap(),
            it.next().unwrap(),
            )
    };

    let l2 = k * x;
    let r2 = k * y;

    let q = l / k;

    let ans = (l > r2 || r < l2) || (k * q < l && k * (q + 1) < r);
    let ans = !ans;

    if ans {
        println!("YES");
    } else {
        println!("NO");
    }
}


use std::io;

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

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

    let mut uppercases = 0;

    for ch in s.chars() {
        if ch.is_uppercase() {
            uppercases += 1;
        }
    }

    let mut first = 1;

    if uppercases > 1 {
        for ch in s.chars() {
            if first == 1 {
                print!("{}", ch.to_uppercase());
                first = 0;
            } else {
                print!("{}", ch.to_lowercase());
            }
        }
    } else {
        println!("{}", s);
    }
}
1


use std::io::stdin;

fn main() {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();
    let line = line.trim().to_string();

    let line_chars: Vec<char> = line.chars().collect();
    let n: usize = line.len();
    if line == line.to_uppercase() {
        println!("{}{}", &line[0..1].to_uppercase(), &line[1..n].to_lowercase());
    } else if line_chars[0].is_lowercase() &&
            &line[1..n] == &line[1..n].to_uppercase() {
        println!("{}{}", &line[0..1].to_uppercase(), &line[1..n].to_lowercase());
    } else {
        println!("{}", line);
    }
}


use std::io;
fn main(){
    println!("{}",operation());
}
fn operation() -> String {
    let (simple,word)=input();
    if word[0].is_lowercase(){
        if word.len()==1{
            return (simple.to_uppercase()).to_string()
        }
        if word[1].is_lowercase(){
            return simple
        }
        let mut n=0;
        for i in 1..word.len(){
            if word[i].is_uppercase(){
                n+=1;
            }
        }
        if n+1==word.len(){
            let mut sum=(word[0].to_uppercase()).to_string();
            for i in 1..word.len(){
                sum+=&((word[i].to_lowercase()).to_string());
            }
            return sum;
        }
    }
    else{
        if word.len()==1{
            return (simple.to_lowercase()).to_string()
        }
        let mut n=0;
        for i in 1..word.len(){
            if word[i].is_uppercase(){
                n+=1;
            }
        }
        if n==word.len(){
            return (simple.to_lowercase()).to_string()
        }
    }
    return simple
}
fn read() -> String{
    let mut input=String::new();
    io::stdin().read_line(&mut input).expect("unable to read");
    input.trim().to_string()
}

fn input() -> (String,Vec<char>){
    let inp=read();
    let l:Vec<char>=inp.chars().collect();
    (inp,l)
}
/*  let n=read().parse::<i32>().expect("Failed to parse");
    let inp=read();
    (n,inp.split_whitespace().map(|x| x.parse::<i32>().expect("Failed to parse")).collect())
    let list: Vec<_>=inp.split_whitespace().collect();
    let qu: Vec<_>=read().chars().collect();
    (list[0].parse::<i32>().expect("Failed to parse"),
    list[1].parse::<i32>().expect("Failed to parse"),qu)
*/


use std::io;

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

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

    let mut uppercase = 0;

    for ch in word.chars() {
        if ch.is_uppercase() {
            uppercase += 1;
        }
    }

    let word = word.trim();

    if uppercase == word.len() || uppercase == word.len()-1 {
        for ch in word.chars() {
            if ch.is_uppercase() {
                print!("{}",ch.to_lowercase());
            } else {
                print!("{}",ch.to_uppercase());
            }
        }
        println!();
    } else {
        println!("{}", word);
    }
}


use std::io;
fn main() {
    let data = read();
    let mut ans = String::new();
    let mut count = 0;
    let mut lower = 0;
    for val in data.chars(){
        if count != 0 {
            if val.is_lowercase(){
                lower = 1;
            }
        }
        count += 1;
    }
    count = 0;
    if lower == 0 {
        for val in data.chars(){
            if count == 0{
                let d : Vec<char> = val.to_uppercase().collect();
                ans.push(d[0]);
            }
            else{
                let d : Vec<char> = val.to_lowercase().collect();
                ans.push(d[0]);
            }
            count += 1;
        }
    }
    else{
        ans = data;
    }
    println!("{}",ans);
}
fn read() -> String{
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    input.trim().parse::<String>().unwrap()
}


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

/// Checks if all chars in a given Vec match a given expression
fn strmbexpr<E: Fn(char) -> bool>(expr: E, chars: Vec<char>) -> bool {
    for c in chars {
        if !expr(c) {
            return false;
        }
    }

    true
}

fn main() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());

    let mut word = scan.next();

    if word.len() == 0 {
        return;
    }

    if word.len() == 1 {
        writeln!(out, "{}", word.to_uppercase()).ok();
    } else {
        if strmbexpr(
            |c| c.is_uppercase() || c.is_whitespace(),
            word.chars().skip(1).collect::<Vec<_>>(),
        ) {
            // invert the caps
            // this is by far the most evil code I've ever written in Rust
            unsafe {
                let ptr = word.as_mut_ptr();
                for i in 1..word.len() {
                    std::ptr::write(
                        ptr.offset(i as isize),
                        word.as_bytes()[i] + ('a' as u8 - 'A' as u8),
                    );
                }
                if *ptr >= 'a' as u8 {
                    std::ptr::write(ptr, word.as_bytes()[0] - 32)
                } else {
                    std::ptr::write(ptr, word.as_bytes()[0] + ('a' as u8 - 'A' as u8))
                }
            }

            writeln!(out, "{}", word).ok();
        } else {
            writeln!(out, "{}", word).ok();
        }
    }
}

pub struct Scanner<T> {
    reader: T,
}

impl<R: io::BufRead> Scanner<R> {
    pub fn new(reader: R) -> Self {
        Self { reader }
    }

    pub fn next(&mut self) -> String {
        loop {
            let mut input = String::new();
            self.reader.read_line(&mut input).unwrap();

            return input.trim().to_owned();
        }
    }
}


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

#[macro_use]
macro_rules! flush {
    () => {
        io::stdout().flush().unwrap();
    };
}

/// Checks if all chars in a given Vec match a given expression
fn strmbexpr<E: Fn(char) -> bool>(expr: E, chars: Vec<char>) -> bool {
    for c in chars {
        if !expr(c) {
            return false;
        }
    }

    true
}

fn main() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());

    let mut word = scan.next();

    match word.len() {
        0 => return,
        1 => {
            writeln!(out, "{}", word.to_uppercase()).ok();
            return;
        }
        _ => (),
    }

    if strmbexpr(
        |c| c.is_uppercase() || c.is_whitespace(),
        word.chars().skip(1).collect::<Vec<_>>(),
    ) {
        // invert the caps
        unsafe {
            let ptr = word.as_mut_ptr();
            for i in 1..word.len() {
                std::ptr::write(ptr.add(i), *ptr.add(i) + 32);
            }

            if *ptr >= 'a' as u8 {
                std::ptr::write(ptr, *ptr - 32)
            } else {
                std::ptr::write(ptr, *ptr + 32)
            }
        }
    }

    writeln!(out, "{}", word).ok();
    flush!();
}

pub struct Scanner<T> {
    reader: T,
}

impl<R: io::BufRead> Scanner<R> {
    pub fn new(reader: R) -> Self {
        Self { reader }
    }

    pub fn next(&mut self) -> String {
        loop {
            let mut input = String::new();
            self.reader.read_line(&mut input).unwrap();

            return input.trim().to_owned();
        }
    }
}


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

fn main() {
    let word: String = read_str();
    let mut result: String = String::new();

    result.push(word.chars().nth(0).expect("Error").to_ascii_uppercase());
    result.push_str(&word[1..].to_lowercase());

    println!("{}{}",
        word.chars().nth(0).expect("Error").to_uppercase(),
        &word[1..].to_lowercase());
}


use std::ascii::AsciiExt;
use std::io;
use std::str;

pub fn main() {
    let mut line = String::new();
    io::stdin().read_line(&mut line).unwrap();
    let line = line.trim_right();

    print!("{}", fix_case(line));
}

pub fn fix_case(s: &str) -> String {
    let s = s.to_owned();

    if is_mistyped(&s) {
        let mut s = s.into_bytes();
        s.make_ascii_lowercase();
        s[0] = s[0].to_ascii_uppercase();
        String::from_utf8(s).unwrap()
    } else {
        s
    }
}

pub fn is_mistyped(s: &str) -> bool {
    let mut iter = s.bytes();
    iter.next();
    iter.all(|c| c >= b'A' && c <= b'Z')
}

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

    #[test]
    fn it_works() {
        assert_eq!("Hello", fix_case("hELLO"));
        assert_eq!("Http", fix_case("HTTP"));
        assert_eq!("Z", fix_case("z"));
        assert_eq!("Caps", fix_case("cAPS"));
        assert_eq!("Lock", fix_case("Lock"));
    }
}


#![allow(non_snake_case, unused_imports, deprecated, dead_code)]

// Input macros
macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); let mut next = || { iter.next().unwrap() }; input_inner!{next, $($r)*} }; ($($r:tt)*) => { let stdin = std::io::stdin(); let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next = move || -> String{ bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect() }; input_inner!{next, $($r)*} }; }
macro_rules! input_inner { ($next:expr) => {}; ($next:expr, ) => {}; ($next:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($next, $t); input_inner!{$next $($r)*} }; ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => { let mut $var = read_value!($next, $t); input_inner!{$next $($r)*} }; }
macro_rules! read_value { ($next:expr, ( $($t:tt),* )) => { ( $(read_value!($next, $t)),* ) }; ($next:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() }; ($next:expr, [ $t:tt ]) => { { let len = read_value!($next, usize); (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() } }; ($next:expr, chars) => { read_value!($next, String).chars().collect::<Vec<char>>() }; ($next:expr, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

// Module
use std::cmp::{min,max};
use std::collections::{VecDeque,HashSet,HashMap,BinaryHeap};
// Module for v1.15.1
use std::ascii::AsciiExt; // deprecated since 1.26.0: use inherent method instead

// Functions

// Main
fn main() {

    input! {
        mut W: chars,
    }

    let mut f = true;
    for i in 1..W.len(){
        if W[i].is_ascii_lowercase() {
            f = false;
            break;
        }
    }

    if f {
        for i in 0..W.len() {
            if i==0 {
                W[i] = W[i].to_ascii_uppercase();
            } else {
                W[i] = W[i].to_ascii_lowercase();
            }
        }
    }

    println!("{}", W.into_iter().collect::<String>());
}


use std::io;

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

    let mut caps = true;

    for (i, c) in s.chars().enumerate() {
        if i != 0 {
            if c.is_lowercase() {
                caps = false;
            }
        }
    }

    if caps {
        s.make_ascii_lowercase();
        let mut iter = s.chars().enumerate();
        let c = iter.next().unwrap();
        s = s.replace(c.1, &c.1.to_ascii_uppercase().to_string());
    }

    print!("{}", s);
}


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 s = scan.next::<String>();
    let uppercase = s.chars().skip(1).all(char::is_uppercase);
    if uppercase {
        write!(out, "{}", s.chars().take(1)
                                   .map(|c| c.to_ascii_uppercase())
                                   .collect::<String>()).expect("fail");
        writeln!(out, "{}", s.chars().skip(1)
                                     .map(|c| c.to_ascii_lowercase())
                                     .collect::<String>()).expect("fail");
    } else {
        writeln!(out, "{}", s).expect("fail");
    }
}


use std::io;

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

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

    input = input.trim().to_lowercase().to_string();

    let decomposed = input.chars().filter(|x| ['a', 'e', 'i', 'o', 'u'].iter().all(|y| y != x));
    let result = decomposed.fold(String::new(), |a, b| format!("{}.{}", a, b));

    println!("{}", result);

    return Ok(());
}


use std::io;

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

    let mut ans = String::new();

    for c in input.to_lowercase().chars() {
        match c {
            'a' | 'e' | 'i' | 'o' | 'u' => continue,
            _ => (),
        }
        ans.push('.');
        ans.push(c);
    }

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


fn main() {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line);
    let ret = line.trim().to_lowercase().chars().fold(String::new(), |ret, c| match c {
        'a' | 'e' | 'i' | 'o' | 'u' => ret,
        _ => ret + "." + &c.to_string(),
    });
    println!("{}", ret);
}


use std::io;

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input)
        .expect("NAN");
    let input = input.trim().to_string().to_lowercase();

    let vowel_string = String::from("aeiou");
    let mut final_str = String::new();

    for c in input.chars() {
        if !vowel_string.contains(c) {
            final_str = format!("{}.{}", final_str, c);
        }
    }
    println!("{}", final_str);
}


use std::io;

fn main() {
    const vowels: [char; 6] = ['a', 'o', 'y', 'e', 'u', 'i'];

    let mut input = String::new();
    io::stdin().read_line(&mut input);

    for letter in input.to_ascii_lowercase().chars() {
        if vowels.contains(&letter) { continue; }
        print!(".");
        print!("{}", letter);
    }
}


fn main() {
    let inp = read_string();
    let inp: String = inp.chars().filter(|c| {
        c.to_lowercase().to_string() != "a" &&
        c.to_lowercase().to_string() != "i" &&
        c.to_lowercase().to_string() != "u" &&
        c.to_lowercase().to_string() != "b" &&
        c.to_lowercase().to_string() != "o" &&
        c.to_lowercase().to_string() != "y"
    }).collect();
    for i in inp.chars() {
        print!(".{}", i.to_lowercase());
    }
}

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


use std::io;

fn main(){
    let mut input = String::new();
    io::stdin().read_line(&mut input).expect("Error reading the input");

    let mut output = String::new();
    for c in input.trim().chars(){
        if !"aoyeui".find(c).is_none(){
            continue;
        } else {
            output.push('.');
            for c_lower in c.to_lowercase(){
                output.push(c_lower);
            }
        }
    }

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


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

fn main() {
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();
    let t: String = s
        .chars()
        .filter_map(|x| {
            let lx = x.to_ascii_lowercase();
            match lx {
                'a' | 'o' | 'y' | 'e' | 'u' | 'i' => None,
                _ => Some(format!(".{}", lx)),
            }
        })
        .collect();
    println!("{}", t)
}


use std::io;

fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s = s.to_lowercase();
    for i in 0..s.len() {
        let c = s.chars().nth(i).unwrap();
        if c == 'a' || c == 'o' || c == 'y' || c == 'e' || c == 'u' || c == 'i' {
            continue;
        }
        print!(".{}", c);
    }
}


use std::io;
fn main(){
    let mut input =String::new();
    io::stdin().read_line(&mut input).unwrap();
    let input = input.trim().parse::<String>().unwrap();
    let input = input.to_lowercase();
    let mut z = String::new();
    for d in input.chars(){
        if d != 'a' && d != 'e' && d != 'i' && d != 'o' && d != 'u'{
            z.push('.');
            z.push(d);
        }
    }
    println!("{}",z);
}


pub fn main(){
    let input = input().to_lowercase();
    let chars = input.chars();
    for c in chars {
        match c {
            'a' | 'e' | 'i' | 'o' | 'u' | 'y' => {}
            _ => {
                print!(".");
                print!("{}", c);
            }
        }
    }
}

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


fn main() {
    let v: Vec<i32> = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().split(" ").map(|s| s.parse::<i32>().unwrap()).collect()
    };

    let (mut a, b) = (v[0], v[1]);
    let mut ret = 0;
    while a != 0 {
        ret += a;
        a = a / b;
    }
    println!("{:?}", ret);
}


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 a = scan.next::<usize>();
    let b = scan.next::<usize>();
    let mut result = a;
    while a>0 {
        a /= b;
        result += a;
    }
    println!("{}", result);
}


// Basics

#![allow(unused_imports)]
#![allow(dead_code)]

extern crate rand;

use std::io::prelude::*;
use std::mem;
use std::io;
use std::io::BufRead;
use std::io::BufReader;
use std::string;
use std::cmp::*;
use std::collections::*;
use std::vec::Vec;
use std::collections::LinkedList;
use std::num;
use std::ops;
use std::fmt::Debug;
use std::str::FromStr;
use rand::Rng;
use std::ops::Shr;

struct Cin {
    data: LinkedList<String>,
}

impl Cin {
    fn new() -> Self {
        Cin { data: LinkedList::new() }
    }
    fn read_line(&self) -> String {
        let mut s: String = String::new();
        io::stdin().read_line(&mut s).expect("err");
        s
    }
    fn read_str(&mut self) -> String {
        if self.data.len() == 0 {
            let s = self.read_line();
//            let split = s.split("\\s+");
            let split = s.split_whitespace();
            for el in split {
                self.data.push_back(String::from(el));
            }
        }
        self.data.pop_front().expect("empty")
    }
    fn read_int(&mut self) -> i64 {
        self.read_str().parse().expect("err parse")
    }
    fn read_vec(&mut self, size: &i64) -> Vec<i64> {
        let mut v: Vec<i64> = Vec::new();
        for _i in 0..*size {
            v.push(self.read_int());
        }
        v
    }
}

fn main() {
    let mut cin = Cin::new();
    let n: i64 = cin.read_int();
    let vec = cin.read_vec(&n);
    let mut s: HashSet<i64> = HashSet::new();
    let mut res: LinkedList<i64> = LinkedList::new();
    for i in 0..vec.len() {
        let ref value = vec[vec.len() - 1 - i];
        let option = s.get(value).is_some();
        if !option {
            s.insert(value.clone());
            res.push_front(*value);
        }
    }
    println!("{}", res.len());
    for r in res { print!("{} ", r); }
    println!();
}


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

    if n % 2 == 0 {
        println!("{:?}", n / 2);
    } else {
        println!("{:?}", n / 2 - n);
    }
}


use std::io;

fn main() {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    let s = buf.trim().parse::<i32>().unwrap();
    let r = match s {
        s if s % 2 == 0 => s - s / 2,
        _ => -(s / 2 + 1),
    };

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


use std::io::stdin;
fn recursiva(arg: i64) -> i64 {
    if arg == 1 {
        return -1;
    } else if arg % 2 == 0 {
        return recursiva(arg - 1) + arg;
    } else {
        return recursiva(arg - 1) - arg;
    }
}

fn main() {
    let mut n = String::new();
    stdin().read_line(&mut n).unwrap();
    let n: i64 = n.trim().parse().unwrap();
    println!("{}", recursiva(n));
}


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 n: i64 = read(sin);

    let ans = (1..n + 1)
        .map(|x| if x % 2 != 0 { -1 * x } else { x })
        .fold(0, |acc, x| acc + x);

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


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

}


#![allow(unused_imports)]
#![allow(unused_macros)]
// use proconio::input;
use std::cmp::{Ordering::*, Reverse};
use std::collections::{BTreeMap, BTreeSet};
use std::io::{self, BufWriter, Write};
use std::str::{self, SplitAsciiWhitespace};

// I have no idea what I'm doing

macro_rules! answer {
    ($out:ident, $ans:expr) => {
        writeln!($out, "{}", $ans)
    };
}

fn main() -> Result<(), io::Error> {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = UnsafeScanner::new(stdin.lock());
    let mut out = BufWriter::new(stdout.lock());

    let (n, m) = scan.pair::<i32>();

    if n == 1 {
        return answer!(out, 1);
    }

    answer!(out, if m-1 <= n-m {
        m+1
    } else {
        m-1
    })
}

///////////////////////////////////////////////////////////////////////////////////////////////////

/// Mostly copied from https://github.com/EbTech/rust-algorithms/blob/master/src/scanner.rs
/// Same API as Scanner but nearly twice as fast, using horribly unsafe dark arts
/// **REQUIRES** Rust 1.34 or higher
pub struct UnsafeScanner<R> {
    reader: R,
    buf_str: Vec<u8>,
    buf_iter: SplitAsciiWhitespace<'static>,
}

impl<R: io::BufRead> UnsafeScanner<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buf_str: vec![],
            buf_iter: "".split_ascii_whitespace(),
        }
    }

    /// This function should be marked unsafe, but noone has time for that in a
    /// programming contest. Use at your own risk!
    pub fn token<T: str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buf_iter.next() {
                return token.parse().ok().expect("Failed parse [Scanner]");
            }
            self.buf_str.clear();
            self.reader
                .read_until(b'\n', &mut self.buf_str)
                .expect("Failed read");
            self.buf_iter = unsafe {
                let slice = str::from_utf8_unchecked(&self.buf_str);
                std::mem::transmute(slice.split_ascii_whitespace())
            }
        }
    }

    pub fn pair<T: str::FromStr>(&mut self) -> (T, T) {
        (self.token(), self.token())
    }
}

// aka #![feature(bool_to_option)]
trait BoolThen {
    fn then_<T>(self, f: impl FnOnce() -> T) -> Option<T>;
}

impl BoolThen for bool {
    fn then_<T>(self, f: impl FnOnce() -> T) -> Option<T> {
        if self {
            Some(f())
        } else {
            None
        }
    }
}

trait BoolToYes {
    fn yes(self) -> &'static str;
}

impl BoolToYes for bool {
    fn yes(self) -> &'static str {
        match self {
            true => "YES",
            false => "NO",
        }
    }
}


//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_macros)]
macro_rules! m {
    ($c:tt, $x:expr, $y:expr) => {{
        let b = $y; let a = &mut $x;
        if b $c *a { *a = b; true } else { false }
    }};
}
#[allow(unused_macros)]
macro_rules! l {
    ($($v:ident),* = $i:ident.$f:ident $a:tt) => {
        $( let $v = $i.$f$a; )*
    };
    ($($v:ident),*:$t:ty = $i:ident.$f:ident $a:tt) => {
        $( let $v:$t = $i.$f$a; )*
    };
}
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).ok();
        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 f(&mut self) ->    f64 { self.p()                }
    fn u(&mut self) ->  usize { self.p()                }
    fn sk(&mut self, n: usize) { self.it.nth(n - 1); }
    fn ii(&mut self, n: usize) -> impl Iterator<Item=i32> {
        self.ip(n).into_iter()
    }
    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 ip<T: FromStr>(&mut self, n: usize) -> impl Iterator<Item=T> where T::Err: Debug {
        self.vp(n).into_iter()
    }
    fn vp<T: FromStr>(&mut self, n: usize) -> Vec<T> where T::Err: Debug {
        (0..n).map(|_| self.p()).collect()
    }
}
//------------------- End rusT

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

    l!(n,m = input.i());
    let sol = if m - 1 >= n - m {
        m - 1
    } else {
        m + 1
    };
    println!("{}", sol);
}


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_vec() -> Vec<u64> {
    return read_line().split(' ')
        .map(|s| s.parse().unwrap())
        .collect();
}

fn read_line_pair() -> (u64, u64) {
    let vec = read_line_vec();
    return (vec[0], vec[1]);
}

fn get_bp(n: u64, m: u64) -> u64 {
    assert!(m > 0);
    let left = m - 1;
    let right = n - m;
    if left == right {
        return m;
    }
    if left < right {
        return m + 1;
    }
    return left;
}

fn main() {
    let (n, m) = read_line_pair();
    let res = get_bp(n, m);

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


use std::cmp;

fn calcu_size(ix: i32, iy: i32, n: i32, second: i32) -> i32 {
    let mut total = 0;
    // middle
    let lefty: i32 = cmp::max(iy - second, 1);
    let righty: i32 = cmp::min(iy + second, n);

    total += righty - lefty + 1;

    // upper
    for i in 0..cmp::min(second, ix - 1) {
        let _row = ix - i - 1;
        let lefty = cmp::max(iy - second + i + 1, 1);
        let righty = cmp::min(iy + second - i - 1, n);
        total += righty - lefty + 1;
    }

    // lower
    for i in 0..cmp::min(second, n - ix) {
        let _row = ix + i + 1;
        let lefty = cmp::max(iy - second + i + 1, 1);
        let righty = cmp::min(iy + second - i - 1, n);
        total += righty - lefty + 1;
    }

    return total;
}

fn main() {
    let mut input_str = String::new();
    std::io::stdin().read_line(&mut input_str).expect("read error");
    let mut iter = input_str.split_whitespace();
    let n: i32 = iter.next().unwrap().parse().unwrap();
    let x: i32 = iter.next().unwrap().parse().unwrap();
    let y: i32 = iter.next().unwrap().parse().unwrap();
    let c: i32 = iter.next().unwrap().parse().unwrap();

    let mut left = -1;
    let mut right = 2 * (((2.0 * (c as f64)).sqrt() as i32) + 1);
    while left != right - 1 {
        let mid = (left + right) >> 1;
        if calcu_size(x, y, n, mid) < c {
            left = mid;
        } else {
            right = mid;
        }
    }
    println!("{}", right);
}


fn read_line() -> String {
    let mut line = String::new();
    std::io::stdin()
        .read_line(&mut line)
        .expect("Could not read line");
    String::from(&line[..line.len() - 1])
}

macro_rules! read_line {
    ([$t: ty]) => {{
        read_line().split_whitespace().map(|token| {
            <$t as std::str::FromStr>::from_str(token).expect(
                &format!(concat!("Could not parse {} into ", stringify!($t)), token))
        })
    }};
    ($($t: ty),*) => {{
        let line = read_line();
        let mut iter = line.split_whitespace();
        ($({
            let token = iter.next().expect("Not enough tokens");
            <$t as std::str::FromStr>::from_str(token).expect(
                &format!(concat!("Could not parse {} into ", stringify!($t)), token))
        }),*)
    }};
}

fn main() {
    read_line!(usize);
    enum State {
        Up,
        Hold,
        Down,
    }
    use State::*;
    let mut state = Up;
    let mut prev = 0;
    let mut ans = true;
    for x in read_line!([u16]) {
        match state {
            Hold => {
                if x > prev {
                    ans = false;
                    break;
                }
            }
            Down => {
                if x >= prev {
                    ans = false;
                    break;
                }
            }
            Up => {}
        }
        state = if x < prev {
            Down
        } else if x > prev {
            Up
        } else {
            Hold
        };
        prev = x;
    }
    println!("{}", if ans { "YES" } else { "NO" });
}


#[macro_export]
macro_rules! scanln {
  ($($var:ident : $ty:path),+) => {
    $(let $var: $ty;)+
    {
      use std::io;
      let mut __buf = String::new();
      io::stdin().read_line(&mut __buf).unwrap();
      let mut eles = __buf.split_whitespace();
      $($var = Scan::scan(&mut eles);)+
    }
  }
}

pub trait Scan {
  fn scan<'a, I>(eles: &mut I) -> Self where I: Iterator<Item=&'a str>;
}

macro_rules! impl_scan_single {
  ($ty:ty) => {
    impl Scan for $ty {
      fn scan<'a, I>(eles: &mut I) -> Self where I: Iterator<Item=&'a str> {
        let next = eles.next().unwrap();
        match next.parse() {
          Ok(res) => res,
          Err(_) => panic!()
        }
      }
    }
  }
}

impl_scan_single!(u8);
impl_scan_single!(u16);
impl_scan_single!(u32);
impl_scan_single!(u64);
impl_scan_single!(usize);
impl_scan_single!(i8);
impl_scan_single!(i16);
impl_scan_single!(i32);
impl_scan_single!(i64);
impl_scan_single!(f32);
impl_scan_single!(f64);
impl_scan_single!(isize);
impl_scan_single!(String);

const __IMPL_SCAN_FOR_VEC: () = {
  use std::str::FromStr;
  impl<T> Scan for Vec<T> where T: FromStr {
    fn scan<'a, I>(eles: &mut I) -> Self where I: Iterator<Item=&'a str> {
      eles.map(|str| match str.parse() {
        Ok(res) => res,
        Err(_) => panic!()
      }).collect()
    }
  }
};

// -----------------------------------------------------------------------------

fn main() {
  scanln!(n: u32, k: u32);
  if (n / k) % 2 == 0 {
    println!("NO");
  } else {
    println!("YES");
  }
}


use std::io::stdin;

fn main() {
    let stdin = stdin();
    let mut s = String::new();
    stdin.read_line(&mut s).unwrap();
    let vec = s.split_whitespace().map(|x| x.parse::<i32>().expect("number parse error")).collect::<Vec<i32>>();
    if (vec[0] / vec[1])&1 > 0 {
        println!("YES");
    } else {
        println!("NO");
    }
}


use std::io::stdin;

fn main() {
    let stdin = stdin();
    let mut s = String::new();
    stdin.read_line(&mut s).unwrap();
    let vec = s.split_whitespace().map(|x| x.parse::<u64>().expect("number parse error")).collect::<Vec<i32>>();
    if (vec[0] / vec[1])&1 > 0 {
        println!("YES");
    } else {
        println!("NO");
    }
}


use std::io;

fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s)
        .expect("failed to read l2");

    let values = s
        .split_whitespace()
        .map(|x| x.parse::<i32>())
        .collect::<Result<Vec<i32>, _>>()
        .unwrap();

    assert!(values.len() == 2);
    let n = values[0];
    let k = values[1];

    if n <= k {
        println!("YES");
    } else {
        let plays = n / k;
        if plays % 2 == 1{
            println!("YES");
        } else {
            println!("NO")
        }
    }

}


use std::io::prelude::*;
use std::io;
use std::str::FromStr;
#[cfg(local)]
use std::fs::File;
#[cfg(local)]
use std::io::BufReader;

#[cfg(local)]
fn buf_read() -> io::Result<(Vec<String>)> {
    let f = try!(File::open("input.txt"));
    let input_lines: Vec<_> = BufReader::new(f).lines().collect();
    let lines: Vec<String> = input_lines.into_iter().map(|e| e.unwrap()).collect();
    Ok((lines))
}

#[cfg(not(local))]
fn buf_read() -> io::Result<(Vec<String>)> {
    let stdin = io::stdin();
    let input_lines: Vec<_> = stdin.lock().lines().collect();
    let lines: Vec<String> = input_lines.into_iter().map(|e| e.unwrap()).collect();
    Ok((lines))
}

fn main() {
    type Element = String;
    let input = buf_read().unwrap();
    let mut input_vectors: Vec<Vec<Element>> = vec![];
    for input_line in input {
        let input_str: Vec<String> = input_line.split(' ').map(String::from).collect();
        let mut input_vector: Vec<Element> = vec![];
        for input_elem_str in input_str {
            let elem: Element = Element::from_str(input_elem_str.as_str()).unwrap();
            input_vector.push(elem);
        }
        input_vectors.push(input_vector);
    }
    let mut k = i64::from_str(&input_vectors[0][1]).unwrap();
    let mut str = input_vectors[1][0].char_indices();
    let mut str2 = str.clone();
    let mut str3 = str.clone();
    let g_position = str2.position(|(u, c)| c == 'G').unwrap() as i64;
    let t_position = str3.position(|(u, c)| c == 'T').unwrap() as i64;
    let mut ii = 0;
    let mut i = 0;
    let mut flag = 0;
    for c in str {
        ii += 1;
        if (ii - 1 <= g_position) && (ii - 1 <= t_position) {
            // println!("g: {:?}", g_position);
            // println!("t: {:?}", t_position);
            // println!("ii: {:?}", ii - 1);
            // println!("hoge");
            continue;
        }
        i += 1;
        if i % k != 0 || (i - 1) == 0 {
            // println!("hoge2");
            // println!("{:?}", i - 1);
            // println!("{:?}", c);
            continue;
        }
        // println!("{:?}", 0 % k);
        // println!("{:?}", k);
        // println!("{:?}", c);
        match c {
            (n, c) => {
                if c == '#' {
                    // println!("No");
                    break;
                } else if c == 'G' || c == 'T' {
                    // println!("Yes");
                    flag = 1;
                    break;
                }
            }
        }
        // println!{"{:?}", c};
    }
    if flag == 0 {
        println!("No");
    } else {
        println!("Yes");
    }
}


use std::io::{self, Stdin};
use std::str::{self, FromStr};
use std::error::Error;
use std::thread;
use std::cmp::*;
fn exec() {
    let mut sc = Scanner::new();
    let _: usize = sc.ne();
    let k: usize = sc.ne();
    let a = sc.ne::<String>().into_bytes();
    let start = a.iter().position(|&x| x == b'G').unwrap();
    let goal = a.iter().position(|&x| x == b'T').unwrap();
    let s = min(start, goal);
    let g = max(start, goal);
    if (g - s) % k != 0 {
        println!("NO");
        std::process::exit(1);
    }
    let mut ok = true;
    let mut cur = s;
    while cur != g {
        if a[cur] == b'#' {
            ok = false;
        }
        cur += k;
    }
    println!("{}", if ok { "YES" } else { "NO" });
}

fn main() {
    const DEFAULT_STACK: usize = 16 * 1024 * 1024;
    let builder = thread::Builder::new();
    let th = builder.stack_size(DEFAULT_STACK);
    let handle = th.spawn(|| { exec(); }).unwrap();
    let _ = handle.join();
}

#[allow(dead_code)]
struct Scanner {
    stdin: Stdin,
    id: usize,
    buf: Vec<u8>,
}

#[allow(dead_code)]
impl Scanner {
    fn new() -> Scanner {
        Scanner {
            stdin: io::stdin(),
            id: 0,
            buf: Vec::new(),
        }
    }
    fn next_line(&mut self) -> Option<String> {
        let mut res = String::new();
        match self.stdin.read_line(&mut res) {
            Ok(0) => return None,
            Ok(_) => Some(res),
            Err(why) => panic!("error in read_line: {}", why.description()),
        }
    }
    fn next<T: FromStr>(&mut self) -> Option<T> {
        while self.buf.len() == 0 {
            self.buf = match self.next_line() {
                Some(r) => {
                    self.id = 0;
                    r.trim().as_bytes().to_owned()
                }
                None => return None,
            };
        }
        let l = self.id;
        assert!(self.buf[l] != b' ');
        let n = self.buf.len();
        let mut r = l;
        while r < n && self.buf[r] != b' ' {
            r += 1;
        }
        let res = match str::from_utf8(&self.buf[l..r]).ok().unwrap().parse::<T>() {
            Ok(s) => Some(s),
            Err(_) => panic!("parse error"),
        };
        while r < n && self.buf[r] == b' ' {
            r += 1;
        }
        if r == n {
            self.buf.clear();
        } else {
            self.id = r;
        }
        res
    }
    fn ne<T: FromStr>(&mut self) -> T {
        self.next::<T>().unwrap()
    }
}


use std::io::{self, Stdin};
use std::str::{self, FromStr};
use std::error::Error;
use std::thread;
use std::cmp::*;
fn exec() {
    let mut sc = Scanner::new();
    let _: usize = sc.ne();
    let k: usize = sc.ne();
    let a = sc.ne::<String>().into_bytes();
    let start = a.iter().position(|&x| x == b'G').unwrap();
    let goal = a.iter().position(|&x| x == b'T').unwrap();
    let s = min(start, goal);
    let g = max(start, goal);
    let mut ok = true;
    if (g - s) % k != 0 {
        ok = false;
    }
    let mut cur = s;
    while cur != g {
        if a[cur] == b'#' {
            ok = false;
        }
        cur += k;
    }
    println!("{}", if ok { "YES" } else { "NO" });
}

fn main() {
    const DEFAULT_STACK: usize = 16 * 1024 * 1024;
    let builder = thread::Builder::new();
    let th = builder.stack_size(DEFAULT_STACK);
    let handle = th.spawn(|| { exec(); }).unwrap();
    let _ = handle.join();
}

#[allow(dead_code)]
struct Scanner {
    stdin: Stdin,
    id: usize,
    buf: Vec<u8>,
}

#[allow(dead_code)]
impl Scanner {
    fn new() -> Scanner {
        Scanner {
            stdin: io::stdin(),
            id: 0,
            buf: Vec::new(),
        }
    }
    fn next_line(&mut self) -> Option<String> {
        let mut res = String::new();
        match self.stdin.read_line(&mut res) {
            Ok(0) => return None,
            Ok(_) => Some(res),
            Err(why) => panic!("error in read_line: {}", why.description()),
        }
    }
    fn next<T: FromStr>(&mut self) -> Option<T> {
        while self.buf.len() == 0 {
            self.buf = match self.next_line() {
                Some(r) => {
                    self.id = 0;
                    r.trim().as_bytes().to_owned()
                }
                None => return None,
            };
        }
        let l = self.id;
        assert!(self.buf[l] != b' ');
        let n = self.buf.len();
        let mut r = l;
        while r < n && self.buf[r] != b' ' {
            r += 1;
        }
        let res = match str::from_utf8(&self.buf[l..r]).ok().unwrap().parse::<T>() {
            Ok(s) => Some(s),
            Err(_) => panic!("parse error"),
        };
        while r < n && self.buf[r] == b' ' {
            r += 1;
        }
        if r == n {
            self.buf.clear();
        } else {
            self.id = r;
        }
        res
    }
    fn ne<T: FromStr>(&mut self) -> T {
        self.next::<T>().unwrap()
    }
}


fn main() {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line);
    let line = line.trim();
    let v: Vec<i32> = line.trim().split(" ").map(|s| s.parse::<i32>().unwrap()).collect();

    let n = v[0];
    let k = v[1];
    // 1 2 3 4 5 6 7 8
    //         |
    // 1 3 5 7 2 4 6 8
    if k * 2 - 1 <= n {
        println!("{:?}", k * 2 - 1);
    } else {
        let mut x = k * 2 - 1 - n;
        if x % 2 == 1 {
            x += 1;
        }
        println!("{:?}", x);
    }
}


use std::io::stdin;

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

    let words: Vec<i64> = line
        .split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect();

    let n = words[0];
    let k = words[1];

    if k <= n / 2 + 1 {
        println!("{}", k * 2 - 1);
    } else if k != n {
        println!("{}", n - 2 * (n - k) - 1);
    } else {
        println!("{}", n - 1);
    }
}


use std::io::*;

fn reads<T: std::str::FromStr>(i: &mut StdinLock) -> Vec<T> {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn operate(n: i64, k: i64) -> (bool, usize) {
    let n = n as f64;
    let k = k as f64;
    let boarder = (n / 2.).ceil();
    let is_even = boarder <= k;
    let idx = if is_even { k - boarder } else { k };
    (is_even, idx as usize)
}

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

    let inputs: Vec<i64> = reads(sin);
    let n = inputs[0];
    let k = inputs[1];

    let (is_even, idx) = operate(n, k);

    let ans = if is_even {
        (1..n + 1).filter(|x| *x % 2 == 0).nth(idx - 1).unwrap()
    } else {
        (1..n + 1).filter(|x| *x % 2 != 0).nth(idx - 1).unwrap()
    };

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


use std::io::*;

fn reads<T: std::str::FromStr>(i: &mut StdinLock) -> Vec<T> {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn operate(n: i64, k: i64) -> (bool, usize) {
    let n = n as f64;
    let k = k as f64;
    let boarder = (n / 2.).ceil();
    let is_even = boarder <= k;
    let idx = if is_even {
        k - boarder + if n as i64 % 2 == 0 { 1. } else { 0. }
    } else {
        k
    };
    (is_even, idx as usize)
}

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

    let inputs: Vec<i64> = reads(sin);
    let n = inputs[0];
    let k = inputs[1];

    let (is_even, idx) = operate(n, k);

    let ans = if is_even {
        (1..n + 1).filter(|x| *x % 2 == 0).nth(idx - 1).unwrap()
    } else {
        (1..n + 1).filter(|x| *x % 2 != 0).nth(idx - 1).unwrap()
    };

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


use std::io::*;

fn reads<T: std::str::FromStr>(i: &mut StdinLock) -> Vec<T> {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn operate(n: i64, k: i64) -> (bool, usize) {
    // 0 1 2 3 4 5 6 7
    // 1
    // 1 2
    // 1 3 2
    // 1 3 2 4
    // 1 3 5 2 4
    // 1 3 5 2 4 6
    // 1 3 5 7 2 4 6
    // 1 3 5 7 2 4 6 8

    if n == 1 {
        return (false, 1);
    }

    let nf = n as f64;

    let start_of_even = (nf / 2.).ceil() as i64 + 1;

    let offset = if start_of_even <= k {
        k - start_of_even + 1
    } else {
        k
    };

    (start_of_even <= k, offset as usize)
}

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

    let inputs: Vec<i64> = reads(sin);
    let n = inputs[0];
    let k = inputs[1];

    let (is_even, idx) = operate(n, k);

    let ans = if is_even {
        (1..n + 1).filter(|x| *x % 2 == 0).nth(idx - 1).unwrap()
    } else {
        (1..n + 1).filter(|x| *x % 2 != 0).nth(idx - 1).unwrap()
    };

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


fn main() {
    let vec: Vec<u64> = get_input().split_ascii_whitespace().map(|v| v.parse().unwrap()).collect();
    let n = vec[0];
    let index = vec[1];

    if n / 2 >= index {
        // ODD NUMBER
        let res = index * 2 - 1;
        println!("{}", res);
    } else {
        // EVEN NUMBER
        let res = (index - n / 2) * 2;
        let res = {
            if n % 2 == 0 {
                res
            } else {
                res - 2
            }
        };
        println!("{}", res);
    }
}

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

fn get_input_usize() -> usize {
    get_input().parse().unwrap()
}


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

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

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

    let words: Vec<i64> =
        line
        .split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect();

    let n = words[0];
    let k = words[1];

    if k < (n+1)/2 {
        println!("{}", 2*k-1);
    } else {
        println!("{}", 2*(k-(n+1)/2));
    }
}


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_vec() -> Vec<i32> {
    return read_line().split(' ')
        .map(|s| s.parse().unwrap())
        .collect();
}

fn read_line_pair() -> (i32, i32) {
    let vec = read_line_vec();
    return (vec[0], vec[1]);
}

fn main() {
    let (n, k) = read_line_pair();

    let even_count = (n + 1) / 2;

    if k <= even_count {
        let res = k * 2 - 1;
        println!("{}", res);
    } else {
        let res = (k - even_count) * 2;
        println!("{}", res);
    }

}


use std::io;
use std::str;

const MOD: i64 = 1_000_000_007;

fn modpow(a: i64, b: i64) -> i64 {
    let mut a = a;
    let mut b = b;
    let mut ans = 1;
    while b > 0 {
        if b % 2 != 0 {
            ans = (ans * a) % MOD;
        }
        a = (a * a) % MOD;
        b /= 2;
    }
    ans
}

fn modinv(a: i64) -> i64 {
    modpow(a, MOD - 2) % MOD
}

fn modadd(a: i64, b: i64) -> i64 {
    let mut ans = (a + b) % MOD;
    if ans < 0 {
        ans += MOD;
    }
    ans
}

fn modmult(a: i64, b: i64) -> i64 {
    let mut ans = (a * b) % MOD;
    if ans < 0 {
        ans += MOD;
    }
    ans
}

fn moddiv(a: i64, b: i64) -> i64 {
    (a * modinv(b)) % MOD
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let a: i64 = scan.token();
    let b: i64 = scan.token();
    let n: i64 = scan.token();
    let x: i64 = scan.token();
    let mut ans;
    if n == 0 {
        ans = x % MOD;
    } else if n == 1 {
        ans = (a * x + b) % MOD;
    } else if a == 1 {
        ans = modadd(x, modmult(b, n));
    } else {
        ans = modpow(a, n);
        ans = modmult(ans, x);
        let mut quotient = modpow(a, n);
        quotient = modadd(quotient, -1);
        quotient = moddiv(quotient, a - 1);
        let mut part = b % MOD;
        part = modmult(part, quotient);
        ans = modadd(ans, part);
        // ans = ((modpow(a, n) * x) % MOD + ((b * (modpow(a, n) - 1).rem_euclid(MOD)) % MOD * modinv(a - 1)) % MOD) % MOD;
    }
    writeln!(out, "{}", ans).ok();
}

fn main() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());
    solve(&mut scan, &mut out);
}

pub struct Scanner<R> {
    reader: R,
    buffer: Vec<String>,
}

impl<R: io::BufRead> Scanner<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buffer: vec![],
        }
    }

    pub fn token<T: 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();
            self.reader.read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }

    pub fn tokens<T: str::FromStr>(&mut self) -> Vec<T> {
        assert!(self.buffer.is_empty());
        let mut input = String::new();
        self.reader.read_line(&mut input).expect("Failed read");
        input
            .split_whitespace()
            .map(|x| x.parse().ok().expect("Failed parse"))
            .collect()
    }
}


use std::io;
use std::str;

pub struct Scanner<R> {
    reader: R,
    buffer: Vec<String>,
}

impl<R: io::BufRead> Scanner<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buffer: vec![],
        }
    }

    pub fn token<T: 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();
            self.reader.read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn factorize(n: u64) -> Vec<(u64, u64)> {
    let mut n = n;
    let mut p = 2;
    let mut ans = Vec::new();
    while p * p <= n && n > 1 {
        let mut expo = 0;
        while n % p == 0 {
            expo += 1;
            n /= p;
        }
        if expo > 1 {
            ans.push((p, expo));
        }
        p += 1;
    }
    if n > 1{
        ans.push((n, 1));
    }
    ans
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let n: u64 = scan.token();
    let factors = factorize(n);
    let mut min_n = 1;
    let mut max_expo = 0;
    for (p, expo) in factors {
        min_n *= p;
        max_expo = max_expo.max(expo);
    }
    let power_of_two = factorize(max_expo.next_power_of_two());
    let (_, min_ops) = power_of_two[0];
    writeln!(out, "{} {}", min_n, min_ops + 1).ok();
}

fn main() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());
    solve(&mut scan, &mut out);
}


use std::io;
use std::str;

pub struct Scanner<R> {
    reader: R,
    buffer: Vec<String>,
}

impl<R: io::BufRead> Scanner<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buffer: vec![],
        }
    }

    pub fn token<T: 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();
            self.reader.read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn factorize(n: u64) -> Vec<(u64, u64)> {
    let mut n = n;
    let mut p = 2;
    let mut ans = Vec::new();
    while p * p <= n && n > 1 {
        let mut expo = 0;
        while n % p == 0 {
            expo += 1;
            n /= p;
        }
        if expo > 0 {
            ans.push((p, expo));
        }
        p += 1;
    }
    if n > 1{
        ans.push((n, 1));
    }
    ans
}

// fn is_power_of_two(n: u64) -> bool {
//     let expo = (n as f64).log2() as u32;
//     2u64.pow(expo) == n
// }

fn log2(n: u64) -> u64 {
    (n as f64).log2() as u64
}

fn find_min_ops(max_expo: u64, factors: &[(u64, u64)]) -> u64 {
    let m = max_expo.next_power_of_two();
    if m == max_expo {
        for (_, expo) in factors {
            if *expo < m {
                return 1 + log2(m);
            }
        }
        return log2(m);
    }
    1 + log2(m)
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let n: u64 = scan.token();
    let factors = factorize(n);
    let mut min_n = 1;
    let mut max_expo = 0u64;
    for (p, expo) in &factors {
        min_n *= p;
        max_expo = max_expo.max(*expo);
    }
    if max_expo == 1 {
        writeln!(out, "{} 0", min_n).ok();
        return;
    }
    let min_ops = find_min_ops(max_expo, &factors);
    writeln!(out, "{} {}", min_n, min_ops).ok();
}

fn main() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());
    solve(&mut scan, &mut out);
}


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 mut n = parse_line!(u32);
    let mut max: u32 = 0;
    let mut min = std::u32::MAX;
    let mut val: u32 = 1;
    for i in 2..n {
        if i * i > n {
            break;
        }
        if n % i != 0 {
            continue;
        }
        val *= i;
        let mut cnt = 0;
        while n % i == 0 {
            n /= i;
            cnt += 1;
        }
        max = std::cmp::max(max, cnt);
        min = std::cmp::min(min, cnt);
    }
    if n != 1 {
        max = std::cmp::max(max, 1);
        min = std::cmp::min(min, 1);
        val *= n;
    }
    let mult = if max != min || max & (max - 1) != 0 {1} else {0};
    if max & (max - 1) != 0 {
        max <<= 1;
    }
    while max & (max - 1) != 0 {
        max &= max - 1;
    }
    println!("{} {}", val, mult + max.trailing_zeros());
}

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


#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn fibonacchi(n: usize) -> Vec<i64> {
    let mut f = vec![0; n + 1];
    f[0] = 1;
    f[1] = 1;
    for i in 2..n + 1 {
        f[i] = (f[i - 1] + f[i - 2]) % 1000_000_007;
    }
    f
}

fn main() {
    let v = read_vec::<usize>();
    let f = fibonacchi(max(v[0], v[1]));
    println!("{}", 2 * (f[v[0]] + f[v[1]] - 1));
}

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

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}