// ---------- begin ModInt ----------
mod modint {

    #[allow(dead_code)]
    pub struct Mod;
    impl ConstantModulo for Mod {
        const MOD: u32 = 1_000_000_007;
    }

    #[allow(dead_code)]
    pub struct StaticMod;
    static mut STATIC_MOD: u32 = 0;
    impl Modulo for StaticMod {
        fn modulo() -> u32 {
            unsafe { STATIC_MOD }
        }
    }

    #[allow(dead_code)]
    impl StaticMod {
        pub fn set_modulo(p: u32) {
            unsafe {
                STATIC_MOD = p;
            }
        }
    }

    use std::marker::*;
    use std::ops::*;

    pub trait Modulo {
        fn modulo() -> u32;
    }

    pub trait ConstantModulo {
        const MOD: u32;
    }

    impl<T> Modulo for T
    where
        T: ConstantModulo,
    {
        fn modulo() -> u32 {
            T::MOD
        }
    }

    pub struct ModInt<T>(pub u32, PhantomData<T>);

    impl<T> Clone for ModInt<T> {
        fn clone(&self) -> Self {
            ModInt::new_unchecked(self.0)
        }
    }

    impl<T> Copy for ModInt<T> {}

    impl<T: Modulo> Add for ModInt<T> {
        type Output = ModInt<T>;
        fn add(self, rhs: Self) -> Self::Output {
            let mut d = self.0 + rhs.0;
            if d >= T::modulo() {
                d -= T::modulo();
            }
            ModInt::new_unchecked(d)
        }
    }

    impl<T: Modulo> AddAssign for ModInt<T> {
        fn add_assign(&mut self, rhs: Self) {
            *self = *self + rhs;
        }
    }

    impl<T: Modulo> Sub for ModInt<T> {
        type Output = ModInt<T>;
        fn sub(self, rhs: Self) -> Self::Output {
            let mut d = T::modulo() + self.0 - rhs.0;
            if d >= T::modulo() {
                d -= T::modulo();
            }
            ModInt::new_unchecked(d)
        }
    }

    impl<T: Modulo> SubAssign for ModInt<T> {
        fn sub_assign(&mut self, rhs: Self) {
            *self = *self - rhs;
        }
    }

    impl<T: Modulo> Mul for ModInt<T> {
        type Output = ModInt<T>;
        fn mul(self, rhs: Self) -> Self::Output {
            let v = self.0 as u64 * rhs.0 as u64 % T::modulo() as u64;
            ModInt::new_unchecked(v as u32)
        }
    }

    impl<T: Modulo> MulAssign for ModInt<T> {
        fn mul_assign(&mut self, rhs: Self) {
            *self = *self * rhs;
        }
    }

    impl<T: Modulo> Neg for ModInt<T> {
        type Output = ModInt<T>;
        fn neg(self) -> Self::Output {
            if self.0 == 0 {
                Self::zero()
            } else {
                Self::new_unchecked(T::modulo() - self.0)
            }
        }
    }

    impl<T> std::fmt::Display for ModInt<T> {
        fn fmt<'a>(&self, f: &mut std::fmt::Formatter<'a>) -> std::fmt::Result {
            write!(f, "{}", self.0)
        }
    }

    impl<T> std::fmt::Debug for ModInt<T> {
        fn fmt<'a>(&self, f: &mut std::fmt::Formatter<'a>) -> std::fmt::Result {
            write!(f, "{}", self.0)
        }
    }

    impl<T: Modulo> std::str::FromStr for ModInt<T> {
        type Err = std::num::ParseIntError;
        fn from_str(s: &str) -> Result<Self, Self::Err> {
            let val = s.parse::<u32>()?;
            Ok(ModInt::new(val))
        }
    }

    impl<T: Modulo> From<usize> for ModInt<T> {
        fn from(val: usize) -> ModInt<T> {
            ModInt::new_unchecked((val % T::modulo() as usize) as u32)
        }
    }

    impl<T: Modulo> From<u64> for ModInt<T> {
        fn from(val: u64) -> ModInt<T> {
            ModInt::new_unchecked((val % T::modulo() as u64) as u32)
        }
    }

    impl<T: Modulo> From<i64> for ModInt<T> {
        fn from(val: i64) -> ModInt<T> {
            let m = T::modulo() as i64;
            ModInt::new((val % m + m) as u32)
        }
    }

    #[allow(dead_code)]
    impl<T> ModInt<T> {
        pub fn new_unchecked(d: u32) -> Self {
            ModInt(d, PhantomData)
        }
        pub fn zero() -> Self {
            ModInt::new_unchecked(0)
        }
        pub fn one() -> Self {
            ModInt::new_unchecked(1)
        }
        pub fn is_zero(&self) -> bool {
            self.0 == 0
        }
    }

    #[allow(dead_code)]
    impl<T: Modulo> ModInt<T> {
        pub fn new(d: u32) -> Self {
            ModInt::new_unchecked(d % T::modulo())
        }
        pub fn pow(&self, mut n: u64) -> Self {
            let mut t = Self::one();
            let mut s = *self;
            while n > 0 {
                if n & 1 == 1 {
                    t *= s;
                }
                s *= s;
                n >>= 1;
            }
            t
        }
        pub fn inv(&self) -> Self {
            assert!(self.0 != 0);
            self.pow(T::modulo() as u64 - 2)
        }
    }
}
// ---------- end ModInt ----------
// ---------- begin Precalc ----------
mod precalc {
    use super::modint::*;
    #[allow(dead_code)]
    pub struct Precalc<T> {
        inv: Vec<ModInt<T>>,
        fact: Vec<ModInt<T>>,
        ifact: Vec<ModInt<T>>,
    }
    #[allow(dead_code)]
    impl<T: Modulo> Precalc<T> {
        pub fn new(n: usize) -> Precalc<T> {
            let mut inv = vec![ModInt::one(); n + 1];
            let mut fact = vec![ModInt::one(); n + 1];
            let mut ifact = vec![ModInt::one(); n + 1];
            for i in 2..(n + 1) {
                fact[i] = fact[i - 1] * ModInt::new_unchecked(i as u32);
            }
            ifact[n] = fact[n].inv();
            if n > 0 {
                inv[n] = ifact[n] * fact[n - 1];
            }
            for i in (1..n).rev() {
                ifact[i] = ifact[i + 1] * ModInt::new_unchecked((i + 1) as u32);
                inv[i] = ifact[i] * fact[i - 1];
            }
            Precalc {
                inv: inv,
                fact: fact,
                ifact: ifact,
            }
        }
        pub fn inv(&self, n: usize) -> ModInt<T> {
            assert!(n > 0);
            self.inv[n]
        }
        pub fn fact(&self, n: usize) -> ModInt<T> {
            self.fact[n]
        }
        pub fn ifact(&self, n: usize) -> ModInt<T> {
            self.ifact[n]
        }
        pub fn perm(&self, n: usize, k: usize) -> ModInt<T> {
            if k > n {
                return ModInt::zero();
            }
            self.fact[n] * self.ifact[n - k]
        }
        pub fn comb(&self, n: usize, k: usize) -> ModInt<T> {
            if k > n {
                return ModInt::zero();
            }
            self.fact[n] * self.ifact[k] * self.ifact[n - k]
        }
    }
}
// ---------- end Precalc ----------

use modint::*;
type M = ModInt<StaticMod>;

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

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

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

use std::io::Write;

// 電源をon にするもの固定すると
// 2つ飛ばしは無理
// 3つ以上連続する部分は左からor右から単調に操作しなければならない
// 最後に置いた空白でDP?

fn run() {
    input! {
        n: usize,
        m: u32,
    }
    StaticMod::set_modulo(m);
    let pc = precalc::Precalc::new(n);
    let mut pow = vec![M::one(); n + 1];
    let two = M::new(2);
    for i in 1..=n {
        pow[i] = pow[i - 1] * two;
    }
    // dp[a][b]: 最後の空白がa, b個置いた
    let mut dp = vec![vec![M::zero(); n + 2]; n + 2];
    dp[0][0] = M::one();
    for i in 0..=(n + 1) {
        for j in 0..=(n + 1) {
            let way = dp[i][j];
            if way.is_zero() {
                continue;
            }
            for k in 1.. {
                if i + k + 1 > n + 1 {
                    break;
                }
                if k > 1 {
                    dp[i + k + 1][j + k] += pow[k - 1] * way * pc.comb(j + k, j);
                } else {
                    dp[i + k + 1][j + k] += way * pc.comb(j + k, j);
                }
            }
        }
    }
    let mut ans = M::zero();
    for dp in dp[n + 1].iter() {
        ans += *dp;
    }
    println!("{}", ans);
}

fn main() {
    run();
}


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

fn count_divisors(n: i64) -> i64 {
    let mut n = n;
    let mut d = 2;
    let mut ans = 1;
    while d * d <= n && n > 1 {
        let mut expo = 0;
        while n % d == 0 {
            n /= d;
            expo += 1;
        }
        ans *= expo + 1;
        d += 1;
    }
    if n > 1 {
        ans *= 2;
    }
    ans
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let b: i64 = scan.token();
    let ans = count_divisors(b);
    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()
    }
}


#![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",
        }
    }
}


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

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

fn main() {
    let mut n = read();
    if n >= 0 {
        println!("{}", n);
    } else {
        n = -n;
        let last_digit = n % 10;
        let before_last_digit = (n / 10) % 10;
        let n_without_last_two_digits = n / 100;
        let ans = -(n_without_last_two_digits * 10 + min(last_digit, before_last_digit));
        println!("{}", ans);
    }
}


// 2018-10-12 10:25
fn main() {
    let n: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    };
    if n >= 0 {
        println!("{:?}", n);
    } else {
        let x = n / 10;
        let y = n % 10 + n / 100 * 10;
        println!("{:?}", std::cmp::max(x, y));
    }
}


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

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 main() {
    let (nodes, edges) = readln!(i64, i64);

    let (min_isolated, max_isolated) = if edges == 0 {
        (nodes, nodes)
    } else {
        (
            if nodes % 2 == 0 {
                max(0, ((nodes + 1) / 2 - edges) * 2)
            } else {
                max(0, ((nodes + 1) / 2 - edges) * 2 - 1)
            },
            nodes - ((1.0 + (8.0 * edges as f64 + 1.0).sqrt()) / 2.0).ceil() as i64
        )
    };

    println!("{} {}", min_isolated, max_isolated);
}


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

#[allow(unused)] macro_rules! arr { ($($n:expr, $T:ty), +) => {{
    let mut inp = String::new(); stdin().read_line(&mut inp).ok();
    let mut s = inp.split(' ').map(|x| x.trim()).filter(|x| x.len() != 0);
    ($({let mut v = Vec::new(); v.reserve(($n) as usize);
        for _ in 0..$n { let t = s.next(); if t == None { break; }
        v.push(t.unwrap().parse::<$T>().unwrap()); } v }),+)
    }};
}

fn bin_search<T: Fn(i64) -> bool>(first: i64, last: i64, func: T) -> i64 {
    let mut l = first;
    let mut r = last;
    let dir = func(l);

    while l + 1 < r {
        let mid = (l + r) / 2;
        if func(mid) == dir {
            l = mid;
        } else {
            r = mid;
        }
    }

    return l
}

fn main() {
    let (nodes, edges) = scan!(i64, i64);
    let min_graph_size = bin_search(0, nodes + 1, |n| n * (n - 1) / 2 < edges) + 1;

    let min_single = if edges == 0 {
        nodes
    } else if 2 * edges >= nodes {
        0
    } else {
        nodes - 2 * edges
    };

    let max_single = if edges == 0 {
        nodes
    } else {
        nodes - min_graph_size
    };

    println!("{} {}", min_single, max_single);
}


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

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

    println!("{}", (1..1 + (input.i().min(input.i()) as i64))
             .product::<i64>());
}


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

fn factorial(n: u32) -> u32 {
    (1..=n).fold(1, |acc, x| acc * x)
}

fn main() {
    let mut line = String::new();
    io::stdin().read_line(&mut line).unwrap();
    let numbers: Vec<u32> = line
        .split_whitespace()
        .map(|s| s.parse().unwrap())
        .collect();
    let a = numbers[0];
    let b = numbers[1];
    let ans = factorial(min(a, b));
    println!("{}", ans);
}


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

#[allow(unused_macros)]
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(),
            )+
        )
    }}
}

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

fn main() {
let (n,k) = readln!(i64,i64);
println!("{}",if (n/k)%2 == 0 { "NO" } else { "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::<u64>().expect("number parse error")).collect::<Vec<u64>>();
    if (vec[0] / vec[1])&1 > 0 {
        println!("YES");
    } else {
        println!("NO");
    }
}


// https://codeforces.com/contest/1271/problem/E
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, [ next / $t:tt ]) => {
        {
            let len = read_value!($iter, usize);
            (0..len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, switch) => {
        {
            let ty = read_value!($iter, i32);
            if ty == 1 {
                vec![ty, read_value!($iter, i32), read_value!($iter, i32)]
            } else if ty == 2 {
                vec![ty, read_value!($iter, i32)]
            } else {
                vec![ty, read_value!($iter, i32)]
            }
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! ifv {
    ($t:expr, $a:expr, $b: expr) => {
        if $t { $a } else { $b }
    }
}

#[allow(unused_macros)]
macro_rules! fill {
    ($t:expr, $v:expr) => {
        for i in 0..$t.len() {
            $t[i] = $v;
        }
    };
}

#[allow(unused_macros)]
macro_rules! join {
    ($t:expr, $glue:expr) => {
        $t.into_iter().map(|w| w.to_string()).collect::<Vec<_>>().join($glue)
    };
}

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

fn exp(upto: usize, k: usize) {
    let mut cnt = vec![0; upto];
    for w in 1..upto {
        let mut ww = w;
        loop {
            cnt[ww] += 1;
            if ww == 1 {
                break;
            }
            if ww % 2 == 0 {
                ww /= 2;
            } else {
                ww -= 1;
            }
        }
    }
    let mut up = 0;
    for w in (1..upto).rev() {
        if cnt[w] > up {
            up = cnt[w];
            // debug!(w, up);
        }
    }
    for w in (1..upto).rev() {
        if cnt[w] >= k {
            println!("{}", w);
            break;
        }
    }
}

fn main() {
    input! {
        n: i64, k: i64
    };

    if n <= 100 {
        exp((n+1) as usize, k as usize);
        return;
    }

    let mut ans = -1;
    let mut tbl = vec![(n, 1), (n-1, ifv!(n % 2 == 0, 1, 2)), (n-2, ifv!(n % 2 == 0, 2, 1))];
    loop {
        // debug!(tbl);
        for &(f, l) in &tbl {
            if k <= l {
                ans = f;
                break;
            }
        }
        if tbl[0].0 <= 1 {
            break;
        }
        if ans != -1 {
            break;
        }

        let mut ntbl: Vec<(i64, i64)> = vec![];
        let tn = tbl.len();
        for nex in 0..4 {
            let to = tbl[0].0 / 2 - nex;
            let mut add = 1;

            // find 2*to
            {
                let mut f2 = false;
                for f in 0..tn {
                    if tbl[f].0 == 2*to {
                        add += tbl[f].1;
                        f2 = true;
                        break;
                    }
                }
                if !f2 {
                    for f in 0..nex {
                        if ntbl[f as usize].0 == 2*to {
                            add += ntbl[f as usize].1;
                            f2 = true;
                            break;
                        }
                    }
                }

                if !f2 {
                    for f in (0..tn).rev() {
                        if tbl[f].0 % 2 == 0 {
                            add += tbl[f].1;
                            break;
                        }
                    }
                }
            }

            // find to+1
            if to % 2 == 0 {
                // we already have that one...
                if nex >= 1 {
                    add += ntbl[(nex-1) as usize].1;
                } else {
                    for f in (0..tn).rev() {
                        if tbl[f].0 % 2 == 1 {
                            add += tbl[f].1;
                            break;
                        }
                    }
                }
            }
            ntbl.push((to, add));
        }
        tbl = ntbl;
    }

    // exp((n+1) as usize);
    println!("{}", ans);
}


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

type GenError = Box<dyn std::error::Error>;
type GenResult<T> = Result<T, GenError>;

struct Reader {

}

impl Reader{
    #[allow(unused)]
    fn read_string() -> GenResult<String> {
        let mut string: String = String::new();
        std::io::stdin().read_line(&mut string)?;
        Ok(string.trim().to_string())
    }

    #[allow(unused)]
    fn read_tokens() -> GenResult<Vec::<String>> {
        let mut string: String = String::new();
        std::io::stdin().read_line(&mut string)?;
        let mut v = Vec::new();
        for value in string.split_whitespace() {
            v.push(value.to_string());
        }
        Ok(v)
    }
}

fn main() {

    let tokens = Reader::read_tokens().unwrap();
    let n: i32 = tokens[0].parse().unwrap();
    let m: i32 = tokens[1].parse().unwrap();
    let k: i32 = tokens[2].parse().unwrap();

    let mut ans = 1000000;
    let mut index = 1;
    for value in Reader::read_tokens().unwrap() {
        let value : i32 = value.parse().unwrap();
        if value > 0 && value <= k {
            ans = min(ans, 10 * (index - m).abs());
        }
        index += 1;
    }
    println!("{}", ans);
}


use std::io::stdin;

#[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 n = scan.next::<usize>();
    let mut a = vec![0; n];
    for i in 0..n {
        a[i] = scan.next::<i32>();
    }
    let mut b = vec![0; n];
    for i in 0..n {
        b[i] = scan.next::<i32>();
    }
    let mut num_a = 0;
    let mut num_b = 0;
    for i in 0..n {
        if a[i] == 1 && b[i] == 0 {
            num_a += 1;
        } else if a[i] == 0 && b[i] == 1 {
            num_b += 1;
        }
    }
    let ans = {
        if num_a == 0 {
            -1
        } else {
            let mut x = 1;
            while num_a * x <= num_b {
                x += 1;
            }
            x
        }
    };
    println!("{}", ans);
}


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

use std::char::*;
use std::cmp::*;
use std::collections::*;
use std::io::*;
use std::str::FromStr;

macro_rules! debug {($($a:expr),*) => {eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
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 ) * } } ; }
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 , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::f64;

fn min<T: PartialOrd>(a:T, b:T) -> T {
    if a < b { a }
    else { b }
}

fn max<T: PartialOrd>(a:T, b:T) -> T {
    if a < b { b }
    else { a }
}

const MAX:usize = 30;
const INF:i64 = std::i64::MAX;
const MOD:i64 = 1e9 as i64 + 7;

struct Graph {
    e: Vec<Vec<usize>>,
    v: Vec<usize>,
    u: Vec<usize>,
    f: Vec<bool>,
    c: i64,
    vc: Vec<i64>,
}

impl Graph {
    fn new(n:usize) -> Self {
        Graph {
            e: vec![vec![];n],
            v: vec![],
            u: vec![n;n],
            f: vec![false;n],
            c: 0,
            vc: vec![0;n],
        }
    }

    fn dfs(&mut self, crt: usize) {
        if self.f[crt] { return; }
        self.c += 1;
        self.f[crt] = true;
        self.v.push(crt);
        self.vc[crt] = self.c;
        self.u[crt] = self.v.len()-1;
        for i in 0..self.e[crt].len() {
            self.dfs(self.e[crt][i]);
        }
        //debug!(crt, self.c, self.vc[crt]);
        self.vc[crt] = self.c - self.vc[crt];
    }
}

fn binary_search(s: &Vec<i64>, v:i64) -> usize {
    let mut left = 0;
    let mut right = s.len();

    while right-left > 1 {
        let mid = (right+left)/2;
        //debug!(left,mid,right,s[mid]);
        if s[mid] < v { left = mid; }
        else { right = mid; }
    }
    left
}

fn main() {
    //let t:usize = read();

    //'outer: for _ in 0..t {
        let n:usize = read();
        let m:usize = read();
        let mut p:Vec<(usize,usize,i64,usize)> = (0..m).map(|i| (read::<usize>()-1,read::<usize>()-1,read(),i)).collect();

        let mut v = vec![];

        let mut f = vec![false;m];
        let mut c = vec![0;m];
        for i in 0..m { c[i] = p[i].2; }

        for i in 0..n {
            // examがあれば実行
            let mut idx = m;
            for j in 0..m {
                if p[j].1 == i {
                    idx = j;
                }
            }
            if idx != m {
                if c[idx] == 0 {
                    v.push(m+1);
                    continue;
                } else {
                    println!("-1");
                    return;
                }
            }
            // 可能なタスクの中で締め切りの近いものを求める
            let mut idx = m;
            let mut dead = n;
            for j in 0..m {
                if !f[j] && p[j].0 <= i && i < p[j].1 {
                    if dead > p[j].1 {
                        dead = p[j].1;
                        idx = j;
                    }
                }
            }

            // 可能なタスクがない場合は休む
            if idx == m {
                v.push(0);
                continue;
            }

            // タスクを実行
            v.push(idx+1);
            c[idx] -= 1;
            if c[idx] == 0 {
                f[idx] = true;
            }

        }

        for e in v {print!("{} ", e);} println!();

    //}
}

/*

*/


#[allow(unused_imports)]
use std::cmp::{max, min};
use std::io::{stdin, stdout, BufWriter, Write};

// code from https://codeforces.com/blog/entry/67391, modified by rkm0959

#[derive(Default)]
struct UnkScanner {
    buffer: Vec<String>,
}

impl UnkScanner {
    fn next<T: std::str::FromStr>(&mut self) -> Option<T> {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok();
            }
            let mut input = String::new();
            match stdin().read_line(&mut input) {
                Ok(0) => return None,
                Err(_) => return None,
                _ => self.buffer = input.split_whitespace().rev().map(String::from).collect(),
            }
        }
    }
}

/*

n even
first "all common" at t
for all t+1 ~ k-1, even number gets it (not n)
-> kills at t as well, sice

n odd
first "all common" at t
all common or even gets it for each k

*/

fn exp(mut x: i64, mut y: i64, md: i64) -> i64 {
    let mut ret: i64 = 1;
    while y > 0 {
        if y % 2 == 1 {
            ret = (ret * x) % md;
        }
        x = (x * x) % md;
        y = y / 2;
    }
    return ret;
}

fn main() {
    let mut scan = UnkScanner::default();
    let out = &mut BufWriter::new(stdout());
    let tc: usize = scan.next::<usize>().expect("");
    let md: i64 = 1_000_000_007;
    for _ in 0..tc {
        let n = scan.next::<i64>().expect("");
        let k = scan.next::<i64>().expect("");
        if k == 0 {
            writeln!(out, "1").ok();
            continue;
        }
        if n % 2 == 0 {
            let mut ans: i64 = 0;
            let v1 = exp(2, n - 1, md) - 1;
            let v2 = exp(2, n, md);
            for i in 0..k {
                // i+1 ~ k-1  2^(n-1) - 1
                // 0, ... i-1 ~ 2^n
                let add: i64 = (exp(v2, i, md) * exp(v1, k - i - 1, md)) % md;
                ans += add;
                if ans >= md {
                    ans -= md;
                }
            }
            let add = exp(v1, k, md);
            ans += add;
            if ans >= md {
                ans -= md;
            }
            writeln!(out, "{}", ans).ok();
        } else {
            let v1 = exp(2, n - 1, md) + 1;
            let ans = exp(v1, k, md);
            writeln!(out, "{}", ans).ok();
        }
    }
    return;
}


use std::io;

const N : usize = 200006;
const P : u64 = 1000000007;
type Farr = [[u64; 4]; N];
type Garr = [u64; N];

fn preprocess(f : &mut Farr, g : &mut Garr) {
  f[0][2] = 1;
  g[0] = 1;
  for i in 0..N-1 {
    f[i+1][3] = f[i][2];
    f[i+1][2] = f[i][3];
    f[i+1][1] = ((f[i][0] + f[i][1]) % P + f[i][3]) % P;
    f[i+1][0] = ((f[i][0] + f[i][1]) % P + f[i][2]) % P;
    g[i+1] = (g[i] + g[i]) % P;
  }

}

fn solve(f : &Farr, g : &Garr) {
  let mut a_str = String::new();
  io::stdin().read_line(&mut a_str).expect("read error");
  let vec = a_str.split_whitespace().map(|x| x.parse::<i32>().unwrap()).collect::<Vec<i32>>();
  let n = vec[0] as usize;
  let k = vec[1] as usize;
  let mut win : u64 = 0;
  let mut tie : u64 = 1;
  for _ in 0..k {
    win = (win * g[n] % P + tie * f[n][2]) % P;
    tie = ((f[n][0] + f[n][3]) % P * tie) % P;
  }
  let ans = (win + tie) % P;
  println!("{}", ans);
}

fn main() {
  let mut str = String::new();
  io::stdin().read_line(&mut str).expect("read error");
  let mut f : Farr = [[0u64; 4]; N];
  let mut g : Garr =  [0u64; N];
  preprocess(&mut f, &mut g);
  if let Some(s) = str.split_whitespace().next() {
    let tests = s.parse::<i32>().unwrap();
    for _ in 0..tests {
      solve(&f, &g);
    }
  }
}


use std::io::stdin;

fn main() {
    stdin().read_line(&mut String::new());

    let mut a = String::new();
    stdin().read_line(&mut a).unwrap();
    let a = a.trim();

    let mut a: Vec<char> = a
        .chars()
        .filter(|x| x != &'0' && x != &'1')
        .collect();

    let mut c = String::new();

    for i in a {
        if i == '4' {
            c.push_str("223");
        } else if i == '6' {
            c.push_str("53");
        } else if i == '8' {
            c.push_str("7222");
        } else if i == '9' {
            c.push_str("2337");
        } else {
            c.push(i);
        }
    }

    let mut c: Vec<u32> = c.chars().map(|x| x.to_digit(10 as u32).unwrap()).collect();

    c.sort();
    c.reverse();

    for i in c {
        print!("{}", i);
    }
    println!();
}


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 _: usize = scan.next();
    let num: String = scan.next();
    let mut cnt = [0usize; 10];
    for c in num.chars() {
        match c {
            '2' => {
                cnt[2] += 1;
            }
            '3' => {
                cnt[3] += 1;
            }
            '4' => {
                cnt[2] += 2;
                cnt[3] += 1;
            }
            '5' => {
                cnt[5] += 1;
            }
            '6' => {
                cnt[3] += 1;
                cnt[5] += 1;
            }
            '7' => {
                cnt[7] += 1;
            }
            '8' => {
                cnt[2] += 3;
                cnt[7] += 1;
            }
            '9' => {
                cnt[2] += 1;
                cnt[3] += 2;
                cnt[7] += 1;
            }
            _ => {}
        }
    }
    for i in (2..10).rev() {
        for _ in 0..cnt[i] {
            print!("{}", i);
        }
    }
    println!();
}

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<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 is_prime(x: usize) -> bool {
    for i in 2..=((x as f64).sqrt() as usize) {
        if x % i == 0 {
            return false;
        }
    }
    return true;
}

fn next_prime(x: usize) -> usize {
    let mut aux = x + 1;
    while !is_prime(aux) {
        aux += 1;
    }
    aux
}

fn _main() {
    let mut scan = Scan::new();
    let n: usize = scan.next();
    let m: usize = scan.next();
    let result = next_prime(n) == m;
    println!("{}", if result { "YES" } else { "NO" });
}

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


// A. Chess Placing http://codeforces.com/contest/985/problem/A

fn main() {
    let stdin = std::io::stdin();
    let mut buf = String::new();
    stdin.read_line(&mut buf).unwrap(); // discard
    buf.clear();
    stdin.read_line(&mut buf).unwrap();
    let mut arr: Vec<i32> = buf.split_whitespace()
        .map(|s| s.parse().unwrap())
        .collect();
    arr[..].sort_unstable();
    let f = |mut m: i32| {
        let mut total = 0;
        for n in &arr {
            total += (n - m).abs();
            m += 2;
        }
        total
    };
    let ans: i32 = vec![1, 2].into_iter().map(f).min().unwrap();
    println!("{}", ans);
}


use io::*;

fn main() {
    let con = read_string();
    let mut sc = Scanner::new(&con);

    let n: usize = sc.next();
    let mut ps: Vec<i64> = sc.next_vec(n / 2);
    ps.sort();

    let mut acc_b = 0;
    let mut acc_w = 0;
    for i in 0..n / 2 {
        acc_b += (ps[i] - 1 - i as i64 * 2).abs();
        acc_w += (ps[i] - 1 - i as i64 * 2 - 1).abs();
    }

    println!("{}", acc_b.min(acc_w));
}

//-----

pub mod io {
    use std;
    use std::str::FromStr;

    pub struct Scanner<'a> {
        iter: std::str::SplitWhitespace<'a>,
    }

    impl<'a> Scanner<'a> {
        pub fn new(s: &'a str) -> Scanner<'a> {
            Scanner {
                iter: s.split_whitespace(),
            }
        }

        pub fn next<T: FromStr>(&mut self) -> T {
            let s = self.iter.next().unwrap();
            if let Ok(v) = s.parse::<T>() {
                v
            } else {
                panic!("Parse error")
            }
        }

        pub fn next_vec_len<T: FromStr>(&mut self) -> Vec<T> {
            let n: usize = self.next();
            self.next_vec(n)
        }

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

    pub fn read_string() -> String {
        use std::io::Read;

        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }

    pub fn read_line() -> String {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    }
}


fn main() {
    let (n, l): (usize, i64) = readln();
    let c: Vec<i64> = readln();

    let mut rest: i64 = l;
    let mut answer = i64::max_value();
    let mut used: i64 = 0;
    while rest > 0 {
        let over_cost = (0..n).filter(|x| rest <= (1i64 << x)).map(|x| c[x]).min();
        if let Some(over_cost) = over_cost {
            answer = min(answer, used + over_cost);
        }
        let last_idx = (0..n).filter(|x| rest >= (1i64 << x)).last().unwrap();
        let cost = (0..last_idx + 1)
            .map(|x| (1i64 << (last_idx - x)) * c[x])
            .min()
            .unwrap();
        let last_pow = (0..36).filter(|x| rest >= (1i64 << x)).last().unwrap();
        used += cost * 1i64 << (last_pow - last_idx);
        rest -= 1i64 << last_pow;
    }
    answer = min(answer, used);
    println!("{}", answer);
}

// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::HashSet;

pub trait FromLn {
    fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
    let mut buf = String::new();
    let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
    T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
    let mut vs = vec![];
    for _ in 0..n {
        vs.push(readln());
    }
    vs
}
macro_rules! fromln_primitives {
    ($($t:ty),*) => { $(
        impl FromLn for $t {
            fn fromln(s: &str) -> $t {
                s.parse().unwrap()
            }
        }
    )* }
}
fromln_primitives!(
    String,
    bool,
    f32,
    f64,
    isize,
    i8,
    i16,
    i32,
    i64,
    usize,
    u8,
    u16,
    u32,
    u64
);
impl<T> FromLn for Vec<T>
where
    T: FromLn,
{
    fn fromln(s: &str) -> Vec<T> {
        s.split_whitespace().map(T::fromln).collect()
    }
}
impl FromLn for Vec<char> {
    fn fromln(s: &str) -> Vec<char> {
        s.chars().collect()
    }
}
macro_rules! fromln_tuple {
    ($($t:ident),*) => {
        impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
            fn fromln(s: &str) -> ($($t),*) {
                let mut it = s.split_whitespace();
                let t = ($($t::fromln(it.next().unwrap())),*);
                assert_eq!(it.next(), None);
                t
            }
        }
    }
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);


#![allow(unused_imports)]
#![allow(unused_macros)]
use std::io::{StdinLock, stdin, BufRead};
use std::collections::*;
use std::cmp::*;

fn scan_helper(lock : &mut StdinLock) -> String {
    let mut buffer = String::new();
    lock.read_line(&mut buffer).ok();
    buffer
}

macro_rules! scan {
    ($lock:ident, $t:ty) => ({
        scan_helper(&mut $lock).split_whitespace()
            .next().unwrap()
            .parse::<$t>().unwrap()
    });
    ($lock:ident, $($t:ty),+) => ({
        let buffer = scan_helper(&mut $lock);
        let mut iter = buffer.split_whitespace();
        ($(
            {
                iter.next().unwrap()
                    .parse::<$t>().unwrap()
            },
        )+)
    })
}

macro_rules! scan_iter {
    ($lock:ident, $t:ty) => ({
        scan_helper(&mut $lock).split_whitespace()
            .map(|x| x.parse::<$t>().unwrap())
            .collect()
    })
}

trait Ext {
    fn idx(&self) -> usize;
    fn num(&self) -> i64;
}

macro_rules! ext {
    ($t:ty) => (
        impl Ext for $t {
            #[inline]
            fn idx(&self) -> usize {
                *self as usize
            }

            #[inline]
            fn num(&self) -> i64 {
                *self as i64
            }
        }
    )
}
ext!(i64);
ext!(usize);

#[derive(Copy, Clone, Debug)]
struct Pair {
    i : usize,
    cost : i64
}
impl PartialOrd for Pair {
    fn partial_cmp(&self, other : &Pair) -> Option<Ordering> {
        Some(self.cost.cmp(&other.cost))
    }
}

impl Ord for Pair {
    fn cmp(&self, other : &Pair) -> Ordering {
        self.partial_cmp(other).unwrap()
    }
}

impl PartialEq for Pair {
    fn eq(&self, other : &Pair) -> bool {
        self.cost == other.cost
    }
}
impl Eq for Pair {}

fn main() {
    let stdin = stdin();
    let mut s = stdin.lock();
    let (n, k) = scan!(s, usize, i64);
    let mut remaining = 4*60 - k;
    let mut count = 0;

    for i in 1..(n+1) {
        if remaining >= 5*i.num() {
            count += 1;
            remaining -= 5*i.num();
        } else {
            break;
        }
    }

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


use std::io;

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input)
        .expect("Failed to read line");

    let split_input : Vec<&str> = input.as_str().split(' ').collect();
    let n : i32 = split_input[0].trim().parse().expect("en");
    let k : i32 = split_input[1].trim().parse().expect("en");
    let m : i32 = 240 - k; // left time
    let mut sum : i32 = 0;
    let mut counter : i32 = 0;
    for i in 1 .. (n + 1) {
        if sum + i * 5 > m {
            break;
        } else {
            sum += i * 5;
            counter += 1;
        }
    }
    println!("{}", counter);
}


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

fn solve<I: BufRead, O: Write>(mut input: I, mut output: O) {
    let from = read_time(&mut input);
    let to = read_time(&mut input);
    let from_minutes = from.0 * 60 + from.1;
    let to_minutes = to.0 * 60 + to.1;
    let mid_minutes = (to_minutes + from_minutes) / 2;
    let mid = (mid_minutes / 60, mid_minutes % 60);
    writeln!(output, "{:02}:{:02}", mid.0, mid.1).unwrap();
}

fn read_time<I: BufRead>(mut input: I) -> (i32, i32) {
    let mut time = String::new();
    input.read_line(&mut time).unwrap();
    let time: Vec<i32> = time.split(':').map(|x| x.trim().parse().unwrap()).collect();
    (time[0], time[1])
}

#[cfg(test)]
mod tests {
    #[test]
    fn example1() {
        assert_eq!(solve("10:00\n11:00\n"), "10:30\n");
    }

    #[test]
    fn example2() {
        assert_eq!(solve("11:10\n11:12\n"), "11:11\n");
    }

    #[test]
    fn example3() {
        assert_eq!(solve("01:02\n03:02\n"), "02:02\n");
    }

    fn solve(input: &str) -> String {
        let mut output = Vec::new();
        super::solve(input.as_bytes(), &mut output);
        String::from_utf8(output).unwrap()
    }
}

fn main() {
    let input = io::stdin();
    let input = input.lock();
    let output = io::stdout();
    let output = output.lock();
    solve(input, output)
}


#[derive(Debug, Eq, PartialEq, Clone, Copy)]
struct Time {
    h: u16,
    m: u16
}

fn parse_time(s: &str) -> Option<Time> {
    let b = s.as_bytes();

    // HH: [0, 1]
    // ':': [2]
    // MM: [3, 4]

    if b.len() != 5 ||
        !(b[0] >= b'0' && b[0] <= b'9') ||
        !(b[1] >= b'0' && b[1] <= b'9') ||
        !(b[2] == b':') ||
        !(b[3] >= b'0' && b[3] <= b'9') ||
        !(b[4] >= b'0' && b[4] <= b'9') {
        None
    } else {
        let h = 10 * ((b[0] - b'0') as u16) + (b[1] - b'0') as u16;
        let m = 10 * ((b[3] - b'0') as u16) + (b[4] - b'0') as u16;

        Some(Time { h, m })
    }
}

#[test]
pub fn test_parse_time() {
    assert_eq!(parse_time(&"00:00"), Some(Time { h: 0, m: 0 }));
    assert_eq!(parse_time(&"23:59"), Some(Time { h: 23, m: 59 }));
    assert_eq!(parse_time(&"aa:bb"), None);
}

fn solve(t1: Time, t2: Time) -> Time {
    let t1_m = t1.h * 60 + t1.m;
    let t2_m = t2.h * 60 + t2.m;
    let t3_m = (t1_m + t2_m) / 2;
    let t3 = Time { h: t3_m / 60, m: t3_m % 60 };

    t3
}

fn main() {
    use std::io;
    let stdin = io::stdin();
    let mut line1 = String::new();
    let mut line2 = String::new();
    stdin.read_line(&mut line1).unwrap();
    stdin.read_line(&mut line2).unwrap();
    let t1 = parse_time(&line1.trim()).unwrap();
    let t2 = parse_time(&line2.trim()).unwrap();
    let t3 = solve(t1, t2);
    println!("{:02}:{:02}", t3.h, t3.m);
}


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

macro_rules! debug(
    ($($arg:tt)*) => { {
        let r = writeln!(&mut ::std::io::stderr(), $($arg)*);
        r.expect("failed printing to stderr");
    } }
);

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

impl Scanner {

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

   fn process(&mut self) -> String {
      if self.buffer.len() == 0 {
         let mut input = String::new();
         std::io::stdin().read_line(&mut input).ok();
         for word in input.split_whitespace() {
            self.buffer.push_back(word.to_string())
         }
      }

      self.buffer.pop_front().unwrap()
   }

   fn next<T : std::str::FromStr >(&mut self) -> T {
      self.process().parse::<T>().ok().unwrap()
   }

   #[allow(dead_code)]
   fn next_char(&mut self) -> char {
      self.process().into_bytes()[0] as char
   }
}

fn cost(x : i64, n : i64, k : i64) -> i64 {
   let left_limit = min(k, x - 1);
   let right_limit = min(n - k - 1, x - 1);

   let left_cost = left_limit*x - (left_limit*(left_limit+1)/2);
   let right_cost = right_limit*x - (right_limit*(right_limit+1)/2);

   let left_extra = max(k - left_limit, 0);
   let right_extra = max((n - k - 1) - right_limit, 0);

   x + left_cost + right_cost + left_extra + right_extra
}

fn search(n : i64, k : i64, m : i64) -> i64 {
   let mut upper = m;
   let mut lower = 1;
   let mut middle = 0;

   while lower <= upper {
      middle = (lower + upper)/2;
      let c = cost(middle, n, k);
      debug!("l: {}, m: {}, u: {}, c: {}", lower, middle, upper, c);

      if c < m {
         lower = middle + 1;
      } else if c > m {
         upper = middle - 1;
      } else {
         break;
      }
   }

   while cost(middle, n, k) > m {
      middle -= 1;
   }

   middle
}

fn main() {
   let mut sin = Scanner::new();
   let (n, m, k) : (i64, i64, i64) = (sin.next(), sin.next(), sin.next());

   println!("{}", search(n, k - 1, m));
}


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 mut n = parse_line!(u64);
    let mut primes = Vec::new();
    for i in 2..n {
        if i * i > n {
            break;
        }
        if n % i != 0 {
            continue;
        }
        n /= i;
        while n % i == 0 {
            n /= i;
        }
        primes.push(i);
    }
    if n != 1 {
        primes.push(n);
    }
    if primes.len() == 1 {
        writeln!(writer, "{}", primes[0]).unwrap();
    }else{
        writeln!(writer, "1").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);
    }
}


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 r: usize = scan.next();
    let c: usize = scan.next();
    let mut grid: Vec<Vec<char>> = vec![];
    for _ in 0..r {
        let input: Vec<char> = scan.next::<String>().chars().take(c).collect();
        grid.push(input);
    }
    let mut rcount = 0usize;
    let mut ccount = 0usize;
    for i in 0..r {
        let mut cake = true;
        for j in 0..c {
            cake = cake & (grid[i][j] == '.');
        }
        if cake {
            rcount += 1;
        }
    }
    for j in 0..c {
        let mut cake = true;
        for i in 0..r {
            cake = cake & (grid[i][j] == '.');
        }
        if cake {
            ccount += 1;
        }
    }
    let result = rcount * c + ccount * r - rcount * ccount;
    println!("{}", result);
}

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


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

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

    let r = input.u();
    let c = input.u();
    use std::collections::HashSet;
    let mut mr = HashSet::new();
    let mut mc = HashSet::new();
    for i in 0..r {
        let s = input.bs();
        for j in 0..c {
            if s[j] == b'S' {
                mr.insert(i);
                mc.insert(j);
            }
        }
    }
    println!("{}", r * c - mr.len() * mc.len());
}


#[allow(unused_imports)]
use std::cmp::{min,max};
use std::io::{BufWriter, stdin, stdout, Write};

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

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

    let mut a = scan.next::<usize>();
    let mut b = scan.next::<usize>();
    let ab = scan.next::<usize>();
    a += ab;
    b += ab;
    let mut ans = 2 * min(a, b);
    if a != b {
        ans += 1;
    }
    writeln!(out, "{}", ans).ok();
}


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

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

    let (n,d) = (input.i(), input.i());
    let sum = d - input.vp::<i32>(n as usize)
        .into_iter().sum::<i32>();
    println!("{}", if sum >= 10 * (n - 1) {
        sum / 5
    } else {
        -1
    });
}


// ---------- begin Matrix ----------
mod matrix {
    use std::ops::*;
    pub trait SemiRing: Add<Output = Self> + Mul<Output = Self> + Copy {
        fn zero() -> Self;
        fn one() -> Self;
    }
    pub trait Inverse: SemiRing {
        fn is_zero() -> bool;
        fn inv(self) -> Self;
    }
    #[derive(Clone)]
    pub struct SquareMatrix<R> {
        size: usize,
        buf: Box<[R]>,
    }
    #[allow(dead_code)]
    impl<R: SemiRing> SquareMatrix<R> {
        pub fn zero(size: usize) -> Self {
            SquareMatrix {
                size: size,
                buf: vec![R::zero(); size * size].into_boxed_slice(),
            }
        }
        pub fn identity(size: usize) -> Self {
            let mut e = Self::zero(size);
            for i in 0..size {
                e.buf[i * size + i] = R::one();
            }
            e
        }
        pub fn set_at(&mut self, x: usize, y: usize, val: R) {
            assert!(x < self.size && y < self.size);
            self.buf[x * self.size + y] = val;
        }
        pub fn get_at(&self, x: usize, y: usize) -> R {
            assert!(x < self.size && y < self.size);
            self.buf[x * self.size + y]
        }
        pub fn get_mut(&mut self, x: usize, y: usize) -> &mut R {
            assert!(x < self.size && y < self.size);
            &mut self.buf[x * self.size + y]
        }
        pub fn matadd(&self, rhs: &Self) -> Self {
            assert!(self.size == rhs.size);
            let buf: Vec<R> = self
                .buf
                .iter()
                .zip(rhs.buf.iter())
                .map(|p| *p.0 + *p.1)
                .collect();
            SquareMatrix {
                size: self.size,
                buf: buf.into_boxed_slice(),
            }
        }
        pub fn matmul(&self, rhs: &Self) -> Self {
            let size = self.size;
            assert!(size == rhs.size);
            let mut res = Self::zero(size);
            for (x, a) in res.buf.chunks_mut(size).zip(self.buf.chunks(size)) {
                for (a, b) in a.iter().zip(rhs.buf.chunks(size)) {
                    for (x, b) in x.iter_mut().zip(b.iter()) {
                        *x = *x + *a * *b;
                    }
                }
            }
            res
        }
        pub fn mat_pow(&self, mut n: usize) -> Self {
            let size = self.size;
            let mut t = Self::identity(size);
            let mut s = self.clone();
            while n > 0 {
                if n & 1 == 1 {
                    t = t.matmul(&s);
                }
                s = s.matmul(&s);
                n >>= 1;
            }
            t
        }
    }
    #[allow(dead_code)]
    impl<R: SemiRing + Sub<Output = R>> SquareMatrix<R> {
        pub fn matsub(&self, rhs: &Self) -> Self {
            assert!(self.size == rhs.size);
            let buf: Vec<R> = self
                .buf
                .iter()
                .zip(rhs.buf.iter())
                .map(|p| *p.0 - *p.1)
                .collect();
            SquareMatrix {
                size: self.size,
                buf: buf.into_boxed_slice(),
            }
        }
    }
    /*
    #[allow(dead_code)]
    impl<R: Inverse + Sub<Output = R>> SquareMatrix<R> {
        pub fn inverse(&self) -> Self {
        }
    }
    */
}
// ---------- end Matrix ----------
// ---------- begin ModInt ----------
// モンゴメリ乗算を用いる
// ほぼCodeforces用
// 注意
// new_unchecked は値xが 0 <= x < modulo であることを仮定
// ModInt の中身は正規化された値で持ってるので直接読んだり書いたりするとぶっ壊れる
// 奇素数のみ
mod modint {

    use std::marker::*;
    use std::ops::*;

    pub trait Modulo {
        fn modulo() -> u32;
        fn rem() -> u32;
        fn ini() -> u64;
        fn reduce(x: u64) -> u32 {
            assert!(x < (Self::modulo() as u64) << 32);
            let b = (x as u32 * Self::rem()) as u64;
            let t = x + b * Self::modulo() as u64;
            let mut c = (t >> 32) as u32;
            if c >= Self::modulo() {
                c -= Self::modulo();
            }
            c as u32
        }
    }

    #[allow(dead_code)]
    pub enum Mod1_000_000_007 {}

    impl Modulo for Mod1_000_000_007 {
        fn modulo() -> u32 {
            1_000_000_007
        }
        fn rem() -> u32 {
            2226617417
        }
        fn ini() -> u64 {
            582344008
        }
    }

    #[allow(dead_code)]
    pub enum Mod998_244_353 {}

    impl Modulo for Mod998_244_353 {
        fn modulo() -> u32 {
            998_244_353
        }
        fn rem() -> u32 {
            998244351
        }
        fn ini() -> u64 {
            932051910
        }
    }

    #[allow(dead_code)]
    pub fn generate_umekomi_modulo(p: u32) {
        assert!(
            p < (1 << 31)
                && p > 2
                && p & 1 == 1
                && (2u32..).take_while(|v| v * v <= p).all(|k| p % k != 0)
        );
        let mut t = 1u32;
        let mut s = !p + 1;
        let mut n = !0u32 >> 2;
        while n > 0 {
            if n & 1 == 1 {
                t *= s;
            }
            s *= s;
            n >>= 1;
        }
        let mut ini = (1u64 << 32) % p as u64;
        ini = (ini << 32) % p as u64;
        assert!(t * p == !0);
        println!("pub enum Mod{} {{}}", p);
        println!("impl Modulo for Mod{} {{", p);
        println!("    fn modulo() -> u32 {{");
        println!("        {}", p);
        println!("    }}");
        println!("    fn rem() -> u32 {{");
        println!("        {}", t);
        println!("    }}");
        println!("    fn ini() -> u32 {{");
        println!("        {}", ini);
        println!("    }}");
        println!("}}");
        let mut f = vec![];
        let mut n = p - 1;
        for i in 2.. {
            if i * i > n {
                break;
            }
            if n % i == 0 {
                f.push(i);
                while n % i == 0 {
                    n /= i;
                }
            }
        }
        if n > 1 {
            f.push(n);
        }
        let mut order = 1;
        let mut n = p - 1;
        while n % 2 == 0 {
            n /= 2;
            order <<= 1;
        }
        let z = (2u64..)
            .find(|z| {
                f.iter()
                    .all(|f| mod_pow(*z, ((p - 1) / *f) as u64, p as u64) != 1)
            })
            .unwrap();
        let zeta = mod_pow(z, ((p - 1) / order) as u64, p as u64);
        println!("impl transform::NTTFriendly for Mod{} {{", p);
        println!("    fn order() -> usize {{");
        println!("        {}", order);
        println!("    }}");
        println!("    fn zeta() -> u32 {{");
        println!("        {}", zeta);
        println!("    }}");
        println!("}}");
    }

    pub struct ModInt<T>(u32, PhantomData<T>);

    impl<T> Clone for ModInt<T> {
        fn clone(&self) -> Self {
            ModInt::build(self.0)
        }
    }

    impl<T> Copy for ModInt<T> {}

    impl<T: Modulo> Add for ModInt<T> {
        type Output = ModInt<T>;
        fn add(self, rhs: Self) -> Self::Output {
            let mut d = self.0 + rhs.0;
            if d >= T::modulo() {
                d -= T::modulo();
            }
            Self::build(d)
        }
    }

    impl<T: Modulo> AddAssign for ModInt<T> {
        fn add_assign(&mut self, rhs: Self) {
            *self = *self + rhs;
        }
    }

    impl<T: Modulo> Sub for ModInt<T> {
        type Output = ModInt<T>;
        fn sub(self, rhs: Self) -> Self::Output {
            let mut d = T::modulo() + self.0 - rhs.0;
            if d >= T::modulo() {
                d -= T::modulo();
            }
            Self::build(d)
        }
    }

    impl<T: Modulo> SubAssign for ModInt<T> {
        fn sub_assign(&mut self, rhs: Self) {
            *self = *self - rhs;
        }
    }

    impl<T: Modulo> Mul for ModInt<T> {
        type Output = ModInt<T>;
        fn mul(self, rhs: Self) -> Self::Output {
            Self::build(T::reduce(self.0 as u64 * rhs.0 as u64))
        }
    }

    impl<T: Modulo> MulAssign for ModInt<T> {
        fn mul_assign(&mut self, rhs: Self) {
            *self = *self * rhs;
        }
    }

    impl<T: Modulo> Neg for ModInt<T> {
        type Output = ModInt<T>;
        fn neg(self) -> Self::Output {
            if self.0 == 0 {
                Self::zero()
            } else {
                Self::build(T::modulo() - self.0)
            }
        }
    }

    impl<T: Modulo> std::fmt::Display for ModInt<T> {
        fn fmt<'a>(&self, f: &mut std::fmt::Formatter<'a>) -> std::fmt::Result {
            write!(f, "{}", self.get())
        }
    }

    impl<T: Modulo> std::fmt::Debug for ModInt<T> {
        fn fmt<'a>(&self, f: &mut std::fmt::Formatter<'a>) -> std::fmt::Result {
            write!(f, "{}", self.get())
        }
    }

    impl<T: Modulo> std::str::FromStr for ModInt<T> {
        type Err = std::num::ParseIntError;
        fn from_str(s: &str) -> Result<Self, Self::Err> {
            let val = s.parse::<u32>()?;
            Ok(ModInt::new(val))
        }
    }

    impl<T: Modulo> From<usize> for ModInt<T> {
        fn from(val: usize) -> ModInt<T> {
            ModInt::new_unchecked((val % T::modulo() as usize) as u32)
        }
    }

    impl<T: Modulo> From<u64> for ModInt<T> {
        fn from(val: u64) -> ModInt<T> {
            ModInt::new_unchecked((val % T::modulo() as u64) as u32)
        }
    }

    impl<T: Modulo> From<i64> for ModInt<T> {
        fn from(val: i64) -> ModInt<T> {
            let m = T::modulo() as i64;
            ModInt::new((val % m + m) as u32)
        }
    }

    #[allow(dead_code)]
    impl<T> ModInt<T> {
        fn build(d: u32) -> Self {
            ModInt(d, PhantomData)
        }
        pub fn zero() -> Self {
            Self::build(0)
        }
        pub fn is_zero(&self) -> bool {
            self.0 == 0
        }
    }

    #[allow(dead_code)]
    impl<T: Modulo> ModInt<T> {
        pub fn new_unchecked(d: u32) -> Self {
            Self::build(T::reduce(d as u64 * T::ini()))
        }
        pub fn new(d: u32) -> Self {
            Self::new_unchecked(d % T::modulo())
        }
        pub fn one() -> Self {
            Self::new_unchecked(1)
        }
        pub fn get(&self) -> u32 {
            T::reduce(self.0 as u64)
        }
        pub fn pow(&self, mut n: u64) -> Self {
            let mut t = Self::one();
            let mut s = *self;
            while n > 0 {
                if n & 1 == 1 {
                    t *= s;
                }
                s *= s;
                n >>= 1;
            }
            t
        }
        pub fn inv(&self) -> Self {
            assert!(!self.is_zero());
            self.pow((T::modulo() - 2) as u64)
        }
    }

    pub fn mod_pow(mut r: u64, mut n: u64, m: u64) -> u64 {
        let mut t = 1 % m;
        while n > 0 {
            if n & 1 == 1 {
                t = t * r % m;
            }
            r = r * r % m;
            n >>= 1;
        }
        t
    }
}
// ---------- end ModInt ----------

use modint::*;

type M = ModInt<Mod998_244_353>;

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

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

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

// 行列累乗っぽいが状態数厳しげでは...

use matrix::*;
type Mat = SquareMatrix<M>;

impl SemiRing for M {
    fn zero() -> Self {
        M::zero()
    }
    fn one() -> Self {
        M::one()
    }
}

fn lcp(x: &[u8], y: &[u8]) -> usize {
    x.iter().zip(y).take_while(|p| *p.0 == *p.1).count()
}

fn run() {
    input! {
        n: usize,
        m: usize,
        s: [bytes; n],
    }
    let mut id = 0;
    let mut map = std::collections::BTreeMap::new();
    for s in s.iter() {
        for i in 0..s.len() {
            let s = s[i..].iter().cloned().collect::<Vec<_>>();
            map.entry(s).or_insert_with(|| {
                let v = id;
                id += 1;
                v
            });
        }
    }
    map.insert(vec![], id);
    id += 1;
    let mut edge = vec![];
    for (x, &src) in map.iter() {
        if x.is_empty() {
            for a in s.iter() {
                for b in s.iter() {
                    let len = lcp(a, b);
                    let a = a[len..].iter().cloned().collect::<Vec<_>>();
                    let b = b[len..].iter().cloned().collect::<Vec<_>>();
                    if !a.is_empty() && !b.is_empty() {
                        continue;
                    }
                    let mut pre = src;
                    for _ in 1..len {
                        edge.push((pre, id));
                        pre = id;
                        id += 1;
                    }
                    if a.is_empty() {
                        let dst = *map.get(&b).unwrap();
                        edge.push((pre, dst));
                    } else if b.is_empty() {
                        let dst = *map.get(&a).unwrap();
                        edge.push((pre, dst));
                    }
                }
            }
        } else {
            for a in s.iter() {
                let len = lcp(a, x);
                let a = a[len..].iter().cloned().collect::<Vec<_>>();
                let b = x[len..].iter().cloned().collect::<Vec<_>>();
                if !a.is_empty() && !b.is_empty() {
                    continue;
                }
                let mut pre = src;
                for _ in 1..len {
                    edge.push((pre, id));
                    pre = id;
                    id += 1;
                }
                if a.is_empty() {
                    let dst = *map.get(&b).unwrap();
                    edge.push((pre, dst));
                } else if b.is_empty() {
                    let dst = *map.get(&a).unwrap();
                    edge.push((pre, dst));
                }
            }
        }
    }
    let mut mat = Mat::zero(id);
    for &(a, b) in edge.iter() {
        *mat.get_mut(a, b) += M::one();
    }
    let pow = mat.mat_pow(m);
    let v = *map.get(&vec![]).unwrap();
    let ans = pow.get_at(v, v);
    println!("{}", ans);
}

fn main() {
    run();
}


fn rand_memory() -> usize {
    Box::into_raw(Box::new("I hope this is a random number")) as usize
}

fn rand() -> usize {
    static mut X: usize = 0;
    unsafe {
        if X == 0 {
            X = rand_memory();
        }
        X ^= X << 13;
        X ^= X >> 17;
        X ^= X << 5;
        X
    }
}
// ---------- begin Matrix ----------
mod matrix {
    use std::ops::*;
    pub trait SemiRing: Add<Output = Self> + Mul<Output = Self> + Copy {
        fn zero() -> Self;
        fn one() -> Self;
    }
    pub trait Inverse: SemiRing {
        fn is_zero() -> bool;
        fn inv(self) -> Self;
    }
    #[derive(Clone)]
    pub struct SquareMatrix<R> {
        size: usize,
        buf: Box<[R]>,
    }
    #[allow(dead_code)]
    impl<R: SemiRing> SquareMatrix<R> {
        pub fn zero(size: usize) -> Self {
            SquareMatrix {
                size: size,
                buf: vec![R::zero(); size * size].into_boxed_slice(),
            }
        }
        pub fn identity(size: usize) -> Self {
            let mut e = Self::zero(size);
            for i in 0..size {
                e.buf[i * size + i] = R::one();
            }
            e
        }
        pub fn set_at(&mut self, x: usize, y: usize, val: R) {
            assert!(x < self.size && y < self.size);
            self.buf[x * self.size + y] = val;
        }
        pub fn get_at(&self, x: usize, y: usize) -> R {
            assert!(x < self.size && y < self.size);
            self.buf[x * self.size + y]
        }
        pub fn get_mut(&mut self, x: usize, y: usize) -> &mut R {
            assert!(x < self.size && y < self.size);
            &mut self.buf[x * self.size + y]
        }
        pub fn matadd(&self, rhs: &Self) -> Self {
            assert!(self.size == rhs.size);
            let buf: Vec<R> = self
                .buf
                .iter()
                .zip(rhs.buf.iter())
                .map(|p| *p.0 + *p.1)
                .collect();
            SquareMatrix {
                size: self.size,
                buf: buf.into_boxed_slice(),
            }
        }
        pub fn matmul(&self, rhs: &Self) -> Self {
            let size = self.size;
            assert!(size == rhs.size);
            let mut res = Self::zero(size);
            for (x, a) in res.buf.chunks_mut(size).zip(self.buf.chunks(size)) {
                for (a, b) in a.iter().zip(rhs.buf.chunks(size)) {
                    for (x, b) in x.iter_mut().zip(b.iter()) {
                        *x = *x + *a * *b;
                    }
                }
            }
            res
        }
        pub fn mat_pow(&self, mut n: usize) -> Self {
            let size = self.size;
            let mut t = Self::identity(size);
            let mut s = self.clone();
            while n > 0 {
                if n & 1 == 1 {
                    t = t.matmul(&s);
                }
                s = s.matmul(&s);
                n >>= 1;
            }
            t
        }
    }
    #[allow(dead_code)]
    impl<R: SemiRing + Sub<Output = R>> SquareMatrix<R> {
        pub fn matsub(&self, rhs: &Self) -> Self {
            assert!(self.size == rhs.size);
            let buf: Vec<R> = self
                .buf
                .iter()
                .zip(rhs.buf.iter())
                .map(|p| *p.0 - *p.1)
                .collect();
            SquareMatrix {
                size: self.size,
                buf: buf.into_boxed_slice(),
            }
        }
    }
    /*
    #[allow(dead_code)]
    impl<R: Inverse + Sub<Output = R>> SquareMatrix<R> {
        pub fn inverse(&self) -> Self {
        }
    }
    */
}
// ---------- end Matrix ----------
// ---------- begin ModInt ----------
// モンゴメリ乗算を用いる
// ほぼCodeforces用
// 注意
// new_unchecked は値xが 0 <= x < modulo であることを仮定
// ModInt の中身は正規化された値で持ってるので直接読んだり書いたりするとぶっ壊れる
// 奇素数のみ
mod modint {

    use std::marker::*;
    use std::ops::*;

    pub trait Modulo {
        fn modulo() -> u32;
        fn rem() -> u32;
        fn ini() -> u64;
        fn reduce(x: u64) -> u32 {
            assert!(x < (Self::modulo() as u64) << 32);
            let b = (x as u32 * Self::rem()) as u64;
            let t = x + b * Self::modulo() as u64;
            let mut c = (t >> 32) as u32;
            if c >= Self::modulo() {
                c -= Self::modulo();
            }
            c as u32
        }
    }

    #[allow(dead_code)]
    pub enum Mod1_000_000_007 {}

    impl Modulo for Mod1_000_000_007 {
        fn modulo() -> u32 {
            1_000_000_007
        }
        fn rem() -> u32 {
            2226617417
        }
        fn ini() -> u64 {
            582344008
        }
    }

    #[allow(dead_code)]
    pub enum Mod998_244_353 {}

    impl Modulo for Mod998_244_353 {
        fn modulo() -> u32 {
            998_244_353
        }
        fn rem() -> u32 {
            998244351
        }
        fn ini() -> u64 {
            932051910
        }
    }

    #[allow(dead_code)]
    pub fn generate_umekomi_modulo(p: u32) {
        assert!(
            p < (1 << 31)
                && p > 2
                && p & 1 == 1
                && (2u32..).take_while(|v| v * v <= p).all(|k| p % k != 0)
        );
        let mut t = 1u32;
        let mut s = !p + 1;
        let mut n = !0u32 >> 2;
        while n > 0 {
            if n & 1 == 1 {
                t *= s;
            }
            s *= s;
            n >>= 1;
        }
        let mut ini = (1u64 << 32) % p as u64;
        ini = (ini << 32) % p as u64;
        assert!(t * p == !0);
        println!("pub enum Mod{} {{}}", p);
        println!("impl Modulo for Mod{} {{", p);
        println!("    fn modulo() -> u32 {{");
        println!("        {}", p);
        println!("    }}");
        println!("    fn rem() -> u32 {{");
        println!("        {}", t);
        println!("    }}");
        println!("    fn ini() -> u32 {{");
        println!("        {}", ini);
        println!("    }}");
        println!("}}");
        let mut f = vec![];
        let mut n = p - 1;
        for i in 2.. {
            if i * i > n {
                break;
            }
            if n % i == 0 {
                f.push(i);
                while n % i == 0 {
                    n /= i;
                }
            }
        }
        if n > 1 {
            f.push(n);
        }
        let mut order = 1;
        let mut n = p - 1;
        while n % 2 == 0 {
            n /= 2;
            order <<= 1;
        }
        let z = (2u64..)
            .find(|z| {
                f.iter()
                    .all(|f| mod_pow(*z, ((p - 1) / *f) as u64, p as u64) != 1)
            })
            .unwrap();
        let zeta = mod_pow(z, ((p - 1) / order) as u64, p as u64);
        println!("impl transform::NTTFriendly for Mod{} {{", p);
        println!("    fn order() -> usize {{");
        println!("        {}", order);
        println!("    }}");
        println!("    fn zeta() -> u32 {{");
        println!("        {}", zeta);
        println!("    }}");
        println!("}}");
    }

    pub struct ModInt<T>(u32, PhantomData<T>);

    impl<T> Clone for ModInt<T> {
        fn clone(&self) -> Self {
            ModInt::build(self.0)
        }
    }

    impl<T> Copy for ModInt<T> {}

    impl<T: Modulo> Add for ModInt<T> {
        type Output = ModInt<T>;
        fn add(self, rhs: Self) -> Self::Output {
            let mut d = self.0 + rhs.0;
            if d >= T::modulo() {
                d -= T::modulo();
            }
            Self::build(d)
        }
    }

    impl<T: Modulo> AddAssign for ModInt<T> {
        fn add_assign(&mut self, rhs: Self) {
            *self = *self + rhs;
        }
    }

    impl<T: Modulo> Sub for ModInt<T> {
        type Output = ModInt<T>;
        fn sub(self, rhs: Self) -> Self::Output {
            let mut d = T::modulo() + self.0 - rhs.0;
            if d >= T::modulo() {
                d -= T::modulo();
            }
            Self::build(d)
        }
    }

    impl<T: Modulo> SubAssign for ModInt<T> {
        fn sub_assign(&mut self, rhs: Self) {
            *self = *self - rhs;
        }
    }

    impl<T: Modulo> Mul for ModInt<T> {
        type Output = ModInt<T>;
        fn mul(self, rhs: Self) -> Self::Output {
            Self::build(T::reduce(self.0 as u64 * rhs.0 as u64))
        }
    }

    impl<T: Modulo> MulAssign for ModInt<T> {
        fn mul_assign(&mut self, rhs: Self) {
            *self = *self * rhs;
        }
    }

    impl<T: Modulo> Neg for ModInt<T> {
        type Output = ModInt<T>;
        fn neg(self) -> Self::Output {
            if self.0 == 0 {
                Self::zero()
            } else {
                Self::build(T::modulo() - self.0)
            }
        }
    }

    impl<T: Modulo> std::fmt::Display for ModInt<T> {
        fn fmt<'a>(&self, f: &mut std::fmt::Formatter<'a>) -> std::fmt::Result {
            write!(f, "{}", self.get())
        }
    }

    impl<T: Modulo> std::fmt::Debug for ModInt<T> {
        fn fmt<'a>(&self, f: &mut std::fmt::Formatter<'a>) -> std::fmt::Result {
            write!(f, "{}", self.get())
        }
    }

    impl<T: Modulo> std::str::FromStr for ModInt<T> {
        type Err = std::num::ParseIntError;
        fn from_str(s: &str) -> Result<Self, Self::Err> {
            let val = s.parse::<u32>()?;
            Ok(ModInt::new(val))
        }
    }

    impl<T: Modulo> From<usize> for ModInt<T> {
        fn from(val: usize) -> ModInt<T> {
            ModInt::new_unchecked((val % T::modulo() as usize) as u32)
        }
    }

    impl<T: Modulo> From<u64> for ModInt<T> {
        fn from(val: u64) -> ModInt<T> {
            ModInt::new_unchecked((val % T::modulo() as u64) as u32)
        }
    }

    impl<T: Modulo> From<i64> for ModInt<T> {
        fn from(val: i64) -> ModInt<T> {
            let m = T::modulo() as i64;
            ModInt::new((val % m + m) as u32)
        }
    }

    #[allow(dead_code)]
    impl<T> ModInt<T> {
        fn build(d: u32) -> Self {
            ModInt(d, PhantomData)
        }
        pub fn zero() -> Self {
            Self::build(0)
        }
        pub fn is_zero(&self) -> bool {
            self.0 == 0
        }
    }

    #[allow(dead_code)]
    impl<T: Modulo> ModInt<T> {
        pub fn new_unchecked(d: u32) -> Self {
            Self::build(T::reduce(d as u64 * T::ini()))
        }
        pub fn new(d: u32) -> Self {
            Self::new_unchecked(d % T::modulo())
        }
        pub fn one() -> Self {
            Self::new_unchecked(1)
        }
        pub fn get(&self) -> u32 {
            T::reduce(self.0 as u64)
        }
        pub fn pow(&self, mut n: u64) -> Self {
            let mut t = Self::one();
            let mut s = *self;
            while n > 0 {
                if n & 1 == 1 {
                    t *= s;
                }
                s *= s;
                n >>= 1;
            }
            t
        }
        pub fn inv(&self) -> Self {
            assert!(!self.is_zero());
            self.pow((T::modulo() - 2) as u64)
        }
    }

    pub fn mod_pow(mut r: u64, mut n: u64, m: u64) -> u64 {
        let mut t = 1 % m;
        while n > 0 {
            if n & 1 == 1 {
                t = t * r % m;
            }
            r = r * r % m;
            n >>= 1;
        }
        t
    }
}
// ---------- end ModInt ----------

use modint::*;

type M = ModInt<Mod998_244_353>;

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

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

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

use matrix::*;
type Mat = SquareMatrix<M>;

impl SemiRing for M {
    fn zero() -> Self {
        M::zero()
    }
    fn one() -> Self {
        M::one()
    }
}

fn lcp(x: &[u8], y: &[u8]) -> usize {
    x.iter().zip(y).take_while(|p| *p.0 == *p.1).count()
}

fn run() {
    input! {
        n: usize,
        m: usize,
        s: [bytes; n],
    }
    let mut id = 0;
    let mut map = std::collections::BTreeMap::new();
    let mut get_id = |s: &Vec<u8>| -> usize {
        *map.entry(s.clone()).or_insert_with(|| {
            let v = id;
            id += 1;
            v
        })
    };
    get_id(&vec![]);
    let mut dfs = vec![vec![]];
    let mut set = std::collections::BTreeSet::new();
    set.insert(vec![]);
    let mut e = vec![];
    while let Some(a) = dfs.pop() {
        let mut edge = vec![];
        if a.is_empty() {
            for a in s.iter() {
                for b in s.iter() {
                    let len = lcp(a, b);
                    let a = a[len..].iter().cloned().collect::<Vec<_>>();
                    let b = b[len..].iter().cloned().collect::<Vec<_>>();
                    if a.is_empty() {
                        if set.insert(b.clone()) {
                            dfs.push(b.clone());
                        }
                        let dst = get_id(&b);
                        edge.push((len, dst));
                    } else if b.is_empty() {
                        if set.insert(a.clone()) {
                            dfs.push(a.clone());
                        }
                        let dst = get_id(&a);
                        edge.push((len, dst));
                    }
                }
            }
        } else {
            for b in s.iter() {
                let len = lcp(&a, b);
                let a = a[len..].iter().cloned().collect::<Vec<_>>();
                let b = b[len..].iter().cloned().collect::<Vec<_>>();
                if a.is_empty() {
                    if set.insert(b.clone()) {
                        dfs.push(b.clone());
                    }
                    let dst = get_id(&b);
                    edge.push((len, dst));
                } else if b.is_empty() {
                    if set.insert(a.clone()) {
                        dfs.push(a.clone());
                    }
                    let dst = get_id(&a);
                    edge.push((len, dst));
                }
            }
        }
        edge.sort();
        let mut pre = get_id(&a);
        let mut cnt = 1;
        for (len, dst) in edge {
            while cnt < len {
                let key = rand().to_be_bytes().to_vec();
                let v = get_id(&key);
                e.push((pre, v));
                pre = v;
                cnt += 1;
            }
            e.push((pre, dst));
        }
    }
    let size = e.iter().map(|p| p.0.max(p.1)).max().unwrap() + 1;
    let mut mat = Mat::zero(size);
    for (a, b) in e {
        *mat.get_mut(a, b) += M::one();
    }
    let ans = mat.mat_pow(m).get_at(0, 0);
    println!("{}", ans);
}

fn main() {
    run();
}


#![allow(unused_imports)]
use {std::cmp::*, std::collections::*, std::io::Write, std::ops::*};

#[allow(unused_macros)]
macro_rules !dbg {($($e :expr ) ,*) =>{#[cfg (debug_assertions ) ] $({let (e ,mut err ) =(stringify !($e ) ,std ::io ::stderr () ) ;writeln !(err ,"{} = {:?}" ,e ,$e ) .unwrap () } ) *} ;}
#[allow(unused_macros)]
macro_rules !min {($a :expr $(,) *) =>{{$a } } ;($a :expr ,$b :expr $(,) *) =>{{std ::cmp ::min ($a ,$b ) } } ;($a :expr ,$($rest :expr ) ,+$(,) *) =>{{std ::cmp ::min ($a ,min !($($rest ) ,+) ) } } ;}
#[allow(unused_macros)]
macro_rules !chmin {($base :expr ,$($cmps :expr ) ,+$(,) *) =>{{let cmp_min =min !($($cmps ) ,+) ;if $base >cmp_min {$base =cmp_min ;true } else {false } } } ;}
#[allow(unused_macros)]
macro_rules !max {($a :expr $(,) *) =>{{$a } } ;($a :expr ,$b :expr $(,) *) =>{{std ::cmp ::max ($a ,$b ) } } ;($a :expr ,$($rest :expr ) ,+$(,) *) =>{{std ::cmp ::max ($a ,max !($($rest ) ,+) ) } } ;}
#[allow(unused_macros)]
macro_rules !chmax {($base :expr ,$($cmps :expr ) ,+$(,) *) =>{{let cmp_max =max !($($cmps ) ,+) ;if $base <cmp_max {$base =cmp_max ;true } else {false } } } ;}

#[allow(dead_code)]
mod scanner {
    use std;
    use std::io::Read;
    use std::str::FromStr;
    use std::str::SplitWhitespace;
    pub struct Scanner<'a> {
        it: SplitWhitespace<'a>,
    }
    impl<'a> Scanner<'a> {
        pub fn new(s: &'a String) -> Scanner<'a> {
            Scanner {
                it: s.split_whitespace(),
            }
        }
        pub fn next<T: FromStr>(&mut self) -> T {
            match self.it.next().unwrap().parse::<T>() {
                Ok(v) => v,
                _ => panic!("Scanner error"),
            }
        }
        pub fn next_chars(&mut self) -> Vec<char> {
            self.next::<String>().chars().collect()
        }
        pub fn next_vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
            (0..len).map(|_| self.next()).collect()
        }
    }
    pub fn read_string() -> String {
        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }
}

fn main() {
    let sc = scanner::read_string();
    let mut sc = scanner::Scanner::new(&sc);
    let out = std::io::stdout();
    let mut out = std::io::BufWriter::new(out.lock());

    let mut f = vec![1i64; 11];
    for i in 2..=10 {
        f[i] = i as i64 * f[i - 1];
    }
    let n: i64 = sc.next();
    let mut ans = combi(n, n / 2);
    ans *= f[n as usize / 2 - 1];
    ans *= f[n as usize / 2 - 1];
    ans /= 2;
    writeln!(out, "{}", ans).unwrap();
}

fn combi(n: i64, r: i64) -> i64 {
    let mut x = 1;
    for i in 1..=r {
        x *= n - i + 1;
        x /= i;
    }
    x
}


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

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

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

fn fact(n: u64) -> u64 {
    (1..=n).product()
}

fn run() {
    input! {
        n: u64,
    }
    let mut ans = fact(n) / fact(n / 2) / fact(n / 2) / 2;
    if n / 2 > 2 {
        ans *= (fact(n / 2  - 1)).pow(2);
    }
    println!("{}", ans);
}

fn main() {
    run();
}


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

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

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

fn run() {
    input! {
        t: usize,
        ask: [(u64, u64); t],
    }
    for (n, k) in ask {
        const MOD: u64 = 1_000_000_007;
        let mut ans = 1;
        for _ in 0..k {
            ans = ans * n % MOD;
        }
        println!("{}", ans);
    }
}

fn main() {
    run();
}


use std::io;
use std::io::Stdin;

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 fix_case(s : &str) -> String {
    let mut uc = 0;
    let mut lc = 0;
    for c in s.chars() {
        if c.is_lowercase() {
            lc = lc + 1;
        } else {
            uc = uc + 1;
        }
    }
    if lc >= uc {
        s.to_lowercase()
    } else {
        s.to_uppercase()
    }
}

fn main() {
    let stdin = io::stdin();
    let mut s = String::new();
    read_line(&stdin, &mut s);
    println!("{}", fix_case(s.trim()));
}


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

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

    stdin.lock().read_line(&mut input).unwrap();

    let input = input.trim();

    let mut num_upper = 0;
    let mut num_lower = 0;

    for c in input.chars() {
        if c.is_uppercase() {
            num_upper += 1;
        } else {
            num_lower += 1;
        }
    }

    if num_upper > num_lower {
        println!("{}", input.to_uppercase());
    }
    else {
        println!("{}", input.to_lowercase());
    }
}