#![allow(dead_code,unused_imports)]
#[rustfmt::skip] mod prefix_sum {use std::fmt::{self, Debug, Formatter};use std::ops::Add;#[derive(Clone)] pub struct PrefixOp<T, I, F> where I: Iterator<Item = T>, F: Fn(T, T) -> T, { iter: I, acc: Option<T>, f: F, }  impl<T, I, F> Iterator for PrefixOp<T, I, F> where I: Iterator<Item = T>, F: Fn(T, T) -> T, T: Clone, { type Item = T;fn next(&mut self) -> Option<Self::Item> { let next = self.iter.next();if let Some(next) = next { if let Some(acc) = self.acc.take() { self.acc = Some((self.f)(acc, next));} else { self.acc = Some(next);} Some(self.acc.clone().unwrap()) } else { None } } }  impl<T, I, F> Debug for PrefixOp<T, I, F> where I: Iterator<Item = T> + Debug, F: Fn(T, T) -> T, T: Debug, { fn fmt(&self, f: &mut Formatter) -> fmt::Result { f.debug_struct("PrefixOp") .field("acc", &self.acc) .field("iter", &self.iter) .finish() } }  pub trait CreatePrefixOps<T, F>: Iterator<Item = T> + Sized where F: Fn(T, T) -> T, { fn prefix_ops(self, op: F) -> PrefixOp<Self::Item, Self, F>;}  impl<T, F, I> CreatePrefixOps<T, F> for I where I: Iterator<Item = T>, F: Fn(T, T) -> T, { fn prefix_ops(self, op: F) -> PrefixOp<Self::Item, Self, F> { PrefixOp { iter: self, acc: None, f: op, } } }  macro_rules! prefix_op_specialisation { ($trait_name:ident, $fn_name:ident, $fn:expr, $($bound_token:tt)+) => { pub trait $trait_name<T>: Iterator<Item = T> + Sized where $($bound_token)+ { fn $fn_name(self) -> PrefixOp<Self::Item, Self, fn(T, T) -> T>;}  impl<T, I> $trait_name<T> for I where I: Iterator<Item = T>, $($bound_token)+ { fn $fn_name(self) -> PrefixOp<Self::Item, Self, fn(T, T) -> T> { PrefixOp { iter: self, acc: None, f: $fn, } } } };}  prefix_op_specialisation!(CreatePrefixSums, prefix_sums, T::add, T: Add<Output = T>);prefix_op_specialisation!(CreatePrefixMax, prefix_max, T::max, T: Ord);prefix_op_specialisation!(CreatePrefixMin, prefix_min, T::min, T: Ord);}
#[rustfmt::skip] mod scanner {use std::io::{stdin, BufReader, Bytes, Error as IoError, Read, Stdin};use std::str::{self, FromStr, Utf8Error};#[derive(Debug)] pub struct Scanner<R: Read> { bytes: Bytes<BufReader<R>>, buf: Vec<u8>, }  #[derive(Debug)] pub enum ScanError<T: FromStr> { Io(IoError), Parse(T::Err, String), NonUtf8(Utf8Error, Vec<u8>), }  impl Scanner<Stdin> { pub fn stdin() -> Self { Self::new(stdin()) } }  impl<R: Read> Scanner<R> { pub fn new(reader: R) -> Self { Self { bytes: BufReader::new(reader).bytes(), buf: Vec::new(), } }  #[allow(clippy::should_implement_trait)] pub fn next<T: FromStr>(&mut self) -> Result<T, ScanError<T>> { assert!(self.buf.is_empty());for b in &mut self.bytes { let b = b.map_err(ScanError::Io)?;if b.is_ascii_whitespace() {  if self.buf.is_empty() { continue;} else { break;} } else { self.buf.push(b);} }   match str::from_utf8(&self.buf) { Err(err) => Err(ScanError::NonUtf8(err, std::mem::take(&mut self.buf))), Ok(s) => { let ret = s.parse().map_err(|err| ScanError::Parse(err, s.to_owned()));self.buf.clear();ret } } } }  #[macro_export] macro_rules! scan { ($scanner:expr) => { $scanner.next().expect("failed to read token") };($scanner:expr, $type:ty) => { $scanner .next::<$type>() .expect(concat!("failed to read token of type ", stringify!($type))) };($scanner:expr, $type:ty; $n:expr) => { (0..$n).map(|_| scan!($scanner)).collect::<Vec<$type>>() };($scanner:expr, $($type:ty),+) => { ($( scan!($scanner, $type), )+) };} }
#[rustfmt::skip] mod writer {use std::fmt::Display;use std::io::{stdout, BufWriter, Error as IoError, Stdout, Write};#[derive(Debug)] pub struct Writer<W: Write> { writer: BufWriter<W>, }  impl Writer<Stdout> { pub fn stdout() -> Self { Self::new(stdout()) } }  impl<W: Write> Writer<W> { pub fn new(writer: W) -> Self { Self { writer: BufWriter::new(writer), } }  pub fn write<M, T: Writable<M>>(&mut self, val: T) -> Result<(), IoError> { val.write_to(&mut self.writer) }  pub fn flush(&mut self) -> Result<(), IoError> { self.writer.flush() } }  pub trait Writable<Mode> { fn write_to<W: Write>(self, w: &mut W) -> Result<(), IoError>;}  #[non_exhaustive] pub struct Single;impl<T: Display> Writable<Single> for T { fn write_to<W: Write>(self, w: &mut W) -> Result<(), IoError> { writeln!(w, "{}", self) } }  #[non_exhaustive] pub struct Many;impl<I> Writable<Many> for I where I: Iterator, I::Item: Display, { fn write_to<W: Write>(mut self, w: &mut W) -> Result<(), IoError> { if let Some(x) = self.next() { write!(w, "{}", x)?;} else {  return Ok(());}  for x in self { write!(w, " {}", x)?;} writeln!(w) } }  #[non_exhaustive] pub struct Array;impl<T: Display> Writable<Array> for &[T] { fn write_to<W: Write>(self, w: &mut W) -> Result<(), IoError> { self.iter().write_to(w) } } }
#[rustfmt::skip] mod util {   pub trait IntoVec<T, _Hack> { fn into_vec(self) -> Vec<T>;}  #[non_exhaustive] pub struct Owned;impl<I, T> IntoVec<T, Owned> for I where I: Iterator<Item = T>, { fn into_vec(self) -> Vec<T> { self.collect() } }  #[non_exhaustive] pub struct Reference;impl<'a, I, T> IntoVec<T, Reference> for I where I: Iterator<Item = &'a T>, T: Clone + 'a, { fn into_vec(self) -> Vec<T> { self.cloned().collect() } }  pub trait Argmax { fn argmax(self) -> Option<usize>;}  impl<I> Argmax for I where I: Iterator, I::Item: Ord, { fn argmax(self) -> Option<usize> { self.fold((0, None), |(i, mx), next| { if let Some((mx_i, mx_v)) = mx { if next.gt(&mx_v) { (i + 1, Some((i, next))) } else { (i + 1, Some((mx_i, mx_v))) } } else { (i + 1, Some((i, next))) } }) .1 .map(|x| x.0) } }  pub trait Sorted { fn sorted(self) -> Self;}  impl<T> Sorted for Vec<T> where T: Ord, { fn sorted(mut self) -> Self { self.sort();self } }  pub trait Choose { fn choose<T>(self, a: T, b: T) -> T;}  impl Choose for bool { fn choose<T>(self, a: T, b: T) -> T { if self { a } else { b } } } }

use prefix_sum::{CreatePrefixOps, CreatePrefixSums, CreatePrefixMax, CreatePrefixMin};
use scanner::Scanner;
use writer::Writer;
use util::{IntoVec, Argmax, Sorted, Choose};

const MOD: i64 = 1_000_000_007;
fn main() {
    let mut sc = Scanner::stdin();
    let mut wr = Writer::stdout();
    for _ in 0..scan!(sc, usize) {
        let (n, k) = scan!(sc, i64, i64);

        if n % 2 == 0 {
            let mut total = 0;
            let a = modexp(2, n - 1) - 1;
            let b = modexp(2, n);
            for i in 0..k {
                total = (total + modexp(a, i) * modexp(b, k - i - 1)) % MOD;
            }
            total = (total + modexp(a, k)) % MOD;
            wr.write(total).unwrap();
        } else {
            let c = (modexp(2, n - 1) - 1 + 2 * (n % 2)) % MOD;
            let total = modexp(c, k);
            wr.write(total).unwrap();
        }
    }
}

const fn modexp(a: i64, b: i64) -> i64 {
    if b == 0 { 1 }
    else if b % 2 == 0 { modexp((a * a) % MOD, b / 2) }
    else { (modexp((a * a) % MOD, b / 2) * a) % MOD}
}

const fn modinv(a: i64) -> i64 {
    modexp(a, MOD - 2)
}


fn main() {
    let mut n: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    };
    let mut group = 1;
    while n > group * 5 {
        n -= group * 5;
        group *= 2;
    }
    let index = (n - 1) / group;
    let names = vec!["Sheldon", "Leonard", "Penny", "Rajesh", "Howard"];
    println!("{}", names[index as usize]);
}


use std::io::stdin;
use std::cmp::*;

fn main() {
    let (n, k) = {
        let mut input = String::new();
        stdin().read_line(&mut input).unwrap();
        let mut it = input.split_whitespace().map(|k| k.parse::<usize>().unwrap());
        (it.next().unwrap(), it.next().unwrap())
    };

    let mut input = String::new();
    stdin().read_line(&mut input).unwrap();
    let it = input.split_whitespace().map(|k| k.parse::<usize>().unwrap());

    let mut ac = 0;
    let mut bc = 0;

    for (i, a) in it.enumerate() {
        ac += a;
        bc += min(ac, 8);
        ac -= min(ac, 8);
        if k <= bc {
            println!("{}", i + 1);
            std::process::exit(0);
        }
    }

    println!("-1");
}


struct Scanner<'a, T: std::io::Read> {
    reader: &'a mut T,
    buffer: [u8; 4096],
    position: usize,
    size: usize
}

impl<'a, T: std::io::Read> Scanner<'a, T> {
    fn new(reader: &'a mut T) -> Scanner<'a, T> {
        Scanner {
            reader,
            buffer: [0; 4096],
            position: 0,
            size: 0
        }
    }

    fn read_block(&mut self) {
        self.size = self.reader.read(&mut self.buffer).unwrap();
        self.position = 0;
    }

    fn read_char(&mut self) -> i32 {
        if self.position >= self.size {
            self.read_block();
            if self.position >= self.size {
                return -1;
            }
        }

        let ch = self.buffer[self.position];
        self.position += 1;

        ch as i32
    }

    fn read_int(&mut self) -> Option<i32> {
        const SPACES: [i32; 4] = [
            ' ' as i32,
            '\n' as i32,
            '\t' as i32,
            '\r' as i32];
        const ZERO: i32 = '0' as i32;
        const NINE: i32 = '9' as i32;
        const NEG: i32 = '-' as i32;

        let mut ch = self.read_char();
        while ch != -1 && SPACES.contains(&ch) {
            ch = self.read_char();
        }

        if ch == -1 {
            return None;
        }

        let mut negative = false;
        if ch == NEG {
            negative = true;
            ch = self.read_char();
        }

        let mut result = 0;
        while ch != -1 && ch >= ZERO && ch <= NINE {
            result = result * 10 + ch - ZERO;
            ch = self.read_char();
        }

        Some(if negative {
            -result
        } else {
            result
        })
    }
}

struct Party {
    id: i32,
    pop: i32
}

fn main() {
    let mut stdin = std::io::stdin();
    let mut reader = Scanner::new(&mut stdin);

    let n = reader.read_int().unwrap();
    let mut a: Vec<Party> = Vec::new();
    for i in 1..=n {
        a.push(Party {
            id: i,
            pop: reader.read_int().unwrap()
        });
    }

    let total_seats: i32 = a.iter().map(|x| x.pop).sum();
    let half_seats = total_seats / 2;
    let master_seats = a[0].pop;
    a.sort_unstable_by_key(|party| party.pop);

    let mut total = master_seats;
    let mut selected = vec![1];
    for party in a {
        if party.id == 1 {
            continue;
        }
        if party.pop > master_seats / 2 {
            break;
        }
        if total > half_seats {
            break;
        }

        selected.push(party.id);
        total += party.pop;
    }

    if total <= half_seats {
        println!("0");
        return;
    }

    println!("{}", selected.len());
    for x in selected {
        print!("{} ", x);
    }
    println!("");
}


#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(dead_code)]

type Vec2<T> = Vec<Vec<T>>;
type Vec3<T> = Vec<Vec<Vec<T>>>;

#[allow(unused_macros)]
macro_rules! invec {
    ( $ t : ty ) => {{
        let mut s = String::new();
        match std::io::stdin().read_line(&mut s) {
            Ok(0) => Vec::<$t>::new(),
            Ok(n) => s
                .trim()
                .split_whitespace()
                .map(|s| s.parse::<$t>().unwrap())
                .collect::<Vec<$t>>(),
            Err(_) => Vec::<$t>::new(),
        }
    }};
}

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

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut 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)*}
    };
    ($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<_>>()
    };

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

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

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

#[allow(unused_macros)]
#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    //($arg:expr) => (println!("{:?}",$arg));
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
}
#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}

macro_rules! echo {
    ($($a:expr),*) => {
          $(println!("{}",$a))*
      }
}

use std::cmp::*;
use std::collections::*;
use std::ops::{Add, Div, Mul, Sub};

#[allow(dead_code)]
static INF_I64: i64 = i64::max_value() / 2;
#[allow(dead_code)]
static INF_I32: i32 = i32::max_value() / 2;
#[allow(dead_code)]
static INF_USIZE: usize = usize::max_value() / 2;
#[allow(dead_code)]
static M_O_D: usize = 1000000007;
#[allow(dead_code)]
static PAI: f64 = 3.1415926535897932;

trait IteratorExt: Iterator {
    fn toVec(self) -> Vec<Self::Item>;
}

impl<T: Iterator> IteratorExt for T {
    fn toVec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

trait CharExt {
    fn toNum(&self) -> usize;
    fn toAlphabetIndex(&self) -> usize;
    fn toNumIndex(&self) -> usize;
}
impl CharExt for char {
    fn toNum(&self) -> usize {
        return *self as usize;
    }
    fn toAlphabetIndex(&self) -> usize {
        return self.toNum() - 'a' as usize;
    }
    fn toNumIndex(&self) -> usize {
        return self.toNum() - '0' as usize;
    }
}

trait VectorExt {
    fn joinToString(&self, s: &str) -> String;
}
impl<T: ToString> VectorExt for Vec<T> {
    fn joinToString(&self, s: &str) -> String {
        return self
            .iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join(s);
    }
}

trait StringExt {
    fn get_reverse(&self) -> String;
}
impl StringExt for String {
    fn get_reverse(&self) -> String {
        self.chars().rev().collect::<String>()
    }
}

trait UsizeExt {
    fn pow(&self, n: usize) -> usize;
}
impl UsizeExt for usize {
    fn pow(&self, n: usize) -> usize {
        return ((*self as u64).pow(n as u32)) as usize;
    }
}

#[derive(Debug, Copy, Clone)]
pub struct ModInt {
    x: i64,
    global_mod: i64,
}
impl ModInt {
    pub fn new(p: i64) -> Self {
        let gm = 998244353;
        let a = (p % gm + gm) % gm;
        return ModInt {
            x: a,
            global_mod: gm,
        };
    }
    pub fn inv(self) -> Self {
        return self.pow(self.global_mod - 2);
    }
    pub fn pow(self, t: i64) -> Self {
        if (t == 0) {
            return ModInt::new(1);
        };
        let mut a = self.pow(t >> 1);
        a = a * a;
        if (t & 1 != 0) {
            a = a * self
        };
        return a;
    }
}
impl Add for ModInt {
    type Output = ModInt;
    fn add(self, other: ModInt) -> ModInt {
        let ret = self.x + other.x;
        return ModInt::new(ret);
    }
}
impl Sub for ModInt {
    type Output = ModInt;
    fn sub(self, other: ModInt) -> ModInt {
        let ret = self.x - other.x;
        return ModInt::new(ret);
    }
}
impl Mul for ModInt {
    type Output = ModInt;
    fn mul(self, other: ModInt) -> ModInt {
        let ret = self.x * other.x;
        return ModInt::new(ret);
    }
}
impl Div for ModInt {
    type Output = ModInt;
    fn div(self, other: ModInt) -> ModInt {
        let ret = self.x * other.inv().x;
        return ModInt::new(ret);
    }
}
impl std::string::ToString for ModInt {
    fn to_string(&self) -> String {
        return self.x.to_string();
    }
}
pub struct Combination {
    fact: Vec<ModInt>,
    ifact: Vec<ModInt>,
}
impl Combination {
    pub fn new(n: i32) -> Self {
        if n > 3000000 {
            panic!("error");
        }
        let mut fact = vec![ModInt::new(0); (n + 1) as usize];
        let mut ifact = vec![ModInt::new(0); (n + 1) as usize];
        fact[0] = ModInt::new(1);
        for i in 1..n + 1 {
            fact[i as usize] = fact[(i - 1) as usize] * ModInt::new(i as i64)
        }
        ifact[n as usize] = fact[n as usize].inv();
        for i in (1..n + 1).rev() {
            ifact[(i - 1) as usize] = ifact[i as usize] * ModInt::new(i as i64)
        }
        let a = Combination {
            fact: fact,
            ifact: ifact,
        };
        return a;
    }
    #[macro_use]
    pub fn gen(&mut self, n: i32, k: i32) -> ModInt {
        if (k < 0 || k > n) {
            return ModInt::new(0 as i64);
        };
        return self.fact[n as usize] * self.ifact[k as usize] * self.ifact[(n - k) as usize];
    }
    pub fn P(&mut self, n: i32, k: i32) -> ModInt {
        self.fact[n as usize] * self.ifact[(n - k) as usize]
    }
}

fn main() {
    let N = get!(usize);

    let mut dp = vec![ModInt::new(0); N + 10];

    dp[0] = ModInt::new(1);

    let mut e = vec![ModInt::new(0); N + 2];
    let mut o = vec![ModInt::new(0); N + 2];

    for i in 0..N + 1 {
        if i % 2 == 0 {
            dp[i] = dp[i] + o[i];
            e[i + 1] = e[i] + dp[i];
            o[i + 1] = o[i];
        } else {
            dp[i] = dp[i] + e[i];
            o[i + 1] = o[i] + dp[i];
            e[i + 1] = e[i];
        }
    }

    mydbg!(dp[N]);
    let mut ans = ModInt::new(1) / ModInt::new(2).pow(N as i64);
    ans = ans * dp[N];
    echo!(ans.to_string());
}


fn read_ints() -> Vec<i32> {
    let mut ln = String::new();
    std::io::stdin().read_line(&mut ln).expect("");
    ln.split_whitespace().filter_map(|w| w.parse().ok()).collect()
}

fn gcd(x: i32, y: i32) -> i32 {
    if y == 0 { x } else { gcd(y, x % y) }
}

fn main() {
    let (mut l, mut r, mut x, mut y) = (0, 0, 0, 0);
    if let [_l, _r, _x, _y] = read_ints()[..] { l = _l; r = _r; x = _x; y = _y; }

    if y % x != 0 {
        println!(0);
        return;
    }
    l = (l + x - 1) / x;
    r /= x;
    y /= x;

    let mut ans = 0i64;
    for i in 1..=(y as f64).sqrt() as i32 {
        if y % i == 0 && gcd(i, y / i) == 1 &&
            i >= l && i <= r &&
            y / i >= l && y / i <= r
        {
            ans += 2 - (i * i == y) as i64;
        }
    }
    println!("{}", ans);
}


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

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

fn solve_part(v: &Vec<(usize, i64)>) -> Option<i64> {
    let diff = v[1].1 - v[0].1;
    let mut was_skipped = false;
    let mut skipped_id = v[0].0;
    let mut last = v[0].1 - diff;
    for (_, (pos, x)) in v.iter().enumerate() {
        if last + diff != *x {
            if was_skipped {
                return None;
            }
            was_skipped = true;
            skipped_id = *pos;
            continue;
        }
        last = *x;
    }
    Some(skipped_id as i64 + 1)
}

fn solve() {
    let s: Vec<_> = parse_line!(String).bytes().collect();
    let n = parse_line!(usize);
    let mut same = false;
    let mut first = false;
    let mut second = false;
    for _ in 0..n {
        let q: Vec<_> = parse_line!(String).bytes().collect();
        same |= s[0] == q[0] && s[1] == q[1];
        first |= s[0] == q[1];
        second |= s[1] == q[0];
    }
    println!("{}", if same || (first && second) {"YES"} else {"NO"})
}

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


// Practice Codeforces
// author: Leonardone @ NEETSDKASU

// 解説読後

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

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

    if n < -2000 {
        let ans = brute_force(n, m as i64);
        println!("{}", ans);
    }

    let mut xs = vec![0; m];

    for i in 0..m {
        let mut c = n / m as i64;
        if i as i64 <= n % m as i64 {
            c += 1;
        }
        xs[i] += c;
    }
    xs[0] -= 1;
    // println!("{:?}", xs);
    let mut ans = 0;
    let c = n / m as i64;
    for i in 0..xs.len() {
        for j in 0..xs.len() {
            let k = (i*i+j*j) % m;
            if k == 0 {
                ans += xs[i] * xs[j];
            }
        }
    }

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

fn gcd(a: i64, b: i64) -> i64 {
    fn _gcd(a: i64, b: i64) -> i64 {
        if a == 0 { b } else { _gcd(b % a, a) }
    }
    let a = a.abs();
    let b = b.abs();
    if a < b { _gcd(a, b) } else { _gcd(b, a) }
}

fn brute_force(n: i64, m: i64) -> i64 {
    let mut ret = 0;
    for i in 1..=n {
        for j in 1..=n {
            let k = i * i + j * j;
            if k % m == 0 {
                ret += 1;
            }
        }
    }
    ret
}


use std::io;
use std::io::prelude::*;

const PRIMES: [u128; 8] = [2, 3, 5, 7, 11, 13, 17, 19];
const WEIGHTS: [u128; 9] = [
    2 * 7 * 17,
    2 * 11,
    2 * 13 * 19,
    7 * 3,
    11 * 3 * 19 * 17,
    3 * 13,
    5 * 7 * 19,
    5 * 11,
    5 * 13 * 17,
];

fn count_powers_of(x: u128, y: u128) -> u128 {
    let mut x = x;
    let mut n = 0;
    while x != 0 && x % y == 0 {
        n += 1;
        x /= y;
    }
    n
}

fn ix(c: char) -> usize {
    match c {
        'X' => 1,
        _ => 0,
    }
}

fn main() {
    let stdin = io::stdin();
    let lines = stdin.lock().lines();
    let board = lines.map(|r| r.unwrap()).take(3).collect::<String>();
    let mut count = vec![0, 0];
    let mut prod = vec![1u128, 1];
    let mut wins = vec![0, 0];
    for (i, c) in board.chars().enumerate().filter(|p| p.1 != '.') {
        count[ix(c)] += 1;
        prod[ix(c)] *= WEIGHTS[i];
    }
    for i in 0..2 {
        for p in PRIMES.iter() {
            if count_powers_of(prod[i], *p) == 3 {
                wins[i] += 1;
            }
        }
    }
    if count[0] != count[1] && count[0] != count[1] - 1
        || wins[0] > 2
        || wins[1] > 2
        || wins[0] * wins[1] != 0
        || wins[0] > 0 && count[0] != count[1]
        || wins[1] > 0 && count[0] != count[1] - 1
    {
        println!("illegal");
    } else if count[0] == 4 && count[1] == 5 && wins[0] + wins[1] == 0 {
        println!("draw");
    } else if wins[0] > 0 {
        println!("the second player won");
    } else if wins[1] > 0 {
        println!("the first player won");
    } else if count[0] == count[1] {
        println!("first");
    } else {
        println!("second");
    }
}


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 n1: usize = scan.next();
    let n2: usize = scan.next();
    let _k1: usize = scan.next();
    let _k2: usize = scan.next();
    println!("{}", if n2>=n1 {"Second"} else {"First"});
}

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


#[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 s = String::from("a") + readln!().as_ref();
    let ans = s.chars().zip(s.chars().skip(1)).map(|(x,y)|{ min((x as u8 + 26 - y as u8) % 26, (y as u8 + 26 - x as u8) % 26) as i32 } ).sum::<i32>();
    println!("{}",ans);
}


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

    let k: u64 = get!();
    let p: u64 = get!();
    let mut ans: u64 = 0;
    for i in 1..k+1 {
        let mut x = i;
        let mut y = i;
        let mut r = 0;
        while x > 0 {
            r = r * 10 + x % 10;
            x /= 10;
            y *= 10;
        }
        ans = (y + r + ans) % p;
    }
    println!("{}", ans);
}


// CodeForces 414b Rust Solution
// (from CF 414b Solution with ruby)

use std::io;

fn main() {
    let stdin = io::stdin();
    let mut line = String::new();
    let modulo = 1_000_000_000 + 7;
    if let Ok(_) = stdin.read_line(&mut line) {
        let words = line.split_whitespace();
        let parsed: Vec<usize> = words.map( |s| s.parse::<usize>().unwrap() ).collect();
        let n = parsed[0];
        let k = parsed[1];
        let mut dp:Vec<Vec<i64>> = vec![vec![0; n + 1usize]; k + 1usize];

        for j in 1..=n {
            dp[1][j] = 1;
        }

        for i in 2..=k {
            for j in 1..=n {
                let mut l = j;
                while l <= n {
                    dp[i][l] = (dp[i][l] + dp[i-1][j])%modulo;
                    l += j;
                }
            }
        }

        //println!("{:?}", dp);
        let mut sum: i64 = 0i64;
        for value in &dp[k] {
            sum = (sum + value)%modulo;
        }

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

// # coding: utf-8
// # Good sequence의 길이는 k, 숫자 제한은 n까지
// # 1부터 n까지 감소 없는 방향으로 (증가 or 같음)으로 만들어지는 Good seq의 수
// # Good seq에서는 이전 숫자가 다음숫자를 나눠도 잘 떨어진다
// # 문제 이해를 제대로 하고 시작합시다.
// # 여기는 1로 끝나도 되고 2로 끝나도 되고 n으로 끝나도 됨
// # 즉 바닥부터 모든 경우가 나와야한다.
// # n = 3, k = 3 에서 한번 트리 분기를 봐보면
// #                           R
// #                1          2          3
// #          1     2    3     2          3
// #  꼴로 반복 된다. 이 해법은 CF 414b의 기존 정답과도 동일함
// #  (1,1) (1,2), (1,3) (2,2), (3,3) total 5 tuples.
// #  이 개수는 tree의 k depth에서의 child 수를 구하는 것과 동일하다.
// #  child에서 1 2 3 이 각각 몇회 나오는지 카운트 한다면 충분할 것 같음
// #
// #  아 근데 자꾸 타임아웃나서 뒈질 것 같네여

// # << 이 문제는 Ruby의 퍼포먼스 문제로 일단 제출 중단합니다. >>

// n, k = gets.split.map(&:to_i)
// MODULO_BASE = 10 ** 9 + 7
// dpcounters = []
// init = Array.new(n + 1) { 1 } # k = 1에서는 각 하나씩
// init[0] = 0 # 당연히 0이죠
// dpcounters << init

// for a in 2..k
//   sub_dpcounter = Array.new(n + 1) { 0 }
//   for b in 1..n
//     c = b
//     while c <= n
//       sub_dpcounter[c] = (sub_dpcounter[c] + dpcounters.last[b]) % MODULO_BASE
//       c += b
//     end
//   end
//   dpcounters << sub_dpcounter
// end

// puts dpcounters.last.inject { |sum, n| (sum + n) % MODULO_BASE }


// ---------- begin ModInt ----------
const MOD: u32 = 998_244_353;

#[derive(Clone, Copy)]
struct ModInt(u32);

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

impl std::ops::AddAssign for ModInt {
    fn add_assign(&mut self, rhs: ModInt) {
        *self = *self + rhs;
    }
}

impl std::ops::Sub for ModInt {
    type Output = ModInt;
    fn sub(self, rhs: ModInt) -> Self::Output {
        let mut d = self.0 + MOD - rhs.0;
        if d >= MOD {
            d -= MOD;
        }
        ModInt(d)
    }
}

impl std::ops::SubAssign for ModInt {
    fn sub_assign(&mut self, rhs: ModInt) {
        *self = *self - rhs;
    }
}

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

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

impl std::ops::Neg for ModInt {
    type Output = ModInt;
    fn neg(self) -> Self::Output {
        ModInt(if self.0 == 0 {0} else {MOD - self.0})
    }
}

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

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

#[allow(dead_code)]
impl ModInt {
    pub fn new(n: u32) -> ModInt {
        ModInt(n % MOD)
    }
    pub fn zero() -> ModInt {
        ModInt(0)
    }
    pub fn one() -> ModInt {
        ModInt(1)
    }
    pub fn pow(self, mut n: u32) -> ModInt {
        let mut t = ModInt::one();
        let mut s = self;
        while n > 0 {
            if n & 1 == 1 {
                t *= s;
            }
            s *= s;
            n >>= 1;
        }
        t
    }
    pub fn inv(self) -> ModInt {
        assert!(self.0 > 0);
        self.pow(MOD - 2)
    }
}
// ---------- end ModInt ----------
// ---------- begin Precalc ----------
#[allow(dead_code)]
struct Precalc {
    inv: Vec<ModInt>,
    fact: Vec<ModInt>,
    ifact: Vec<ModInt>,
}

#[allow(dead_code)]
impl Precalc {
    pub fn new(n: usize) -> Precalc {
        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) {
            inv[i] = -inv[MOD as usize % i] * ModInt(MOD / i as u32);
            fact[i] = fact[i - 1] * ModInt(i as u32);
            ifact[i] = ifact[i - 1] * inv[i];
        }
        Precalc {
            inv: inv,
            fact: fact,
            ifact: ifact,
        }
    }
    pub fn inv(&self, n: usize) -> ModInt {
        self.inv[n]
    }
    pub fn fact(&self, n: usize) -> ModInt {
        self.fact[n]
    }
    pub fn ifact(&self, n: usize) -> ModInt {
        self.ifact[n]
    }
    pub fn comb(&self, n: usize, k: usize) -> ModInt {
        if k > n {
            return ModInt::zero();
        }
        self.fact[n] * self.ifact[k] * self.ifact[n - k]
    }
}
// ---------- end Precalc ----------
// ---------- begin Matrix ----------
#[allow(dead_code)]
mod matrix {
    use std::ops::{Add, Mul};
    pub trait SemiRing: Add<Output = Self> + Mul<Output = Self> + Copy {
        fn zero() -> Self;
        fn one() -> Self;
    }
    pub const SIZE: usize = 2;
    #[derive(Clone)]
    pub struct SquareMatrix<T: SemiRing> {
        buf: [[T; SIZE]; SIZE],
    }
    impl<T: SemiRing> SquareMatrix<T> {
        pub fn zero() -> Self {
            let z = T::zero();
            SquareMatrix {
                buf: [[z; SIZE]; SIZE],
            }
        }
        pub fn identity() -> Self {
            let mut m = Self::zero();
            for i in 0..SIZE {
                m.buf[i][i] = T::one();
            }
            m
        }
        pub fn set_at(&mut self, i: usize, j: usize, v: T) {
            self.buf[i][j] = v;
        }
        pub fn get_at(&self, i: usize, j: usize) -> T {
            self.buf[i][j]
        }
        pub fn matmul(&self, rhs: &Self) -> Self {
            let mut res = Self::zero();
            for (x, a) in res.buf.iter_mut().zip(self.buf.iter()) {
                for (a, b) in a.iter().zip(rhs.buf.iter()) {
                    for (x, b) in x.iter_mut().zip(b.iter()) {
                        *x = *x + *a * *b;
                    }
                }
            }
            res
        }
        pub fn matadd(&self, rhs: &Self) -> Self {
            let mut c = Self::zero();
            for (c, (a, b)) in c.buf.iter_mut().zip(self.buf.iter().zip(rhs.buf.iter())) {
                for (c, (a, b)) in c.iter_mut().zip(a.iter().zip(b.iter())) {
                    *c = *a + *b;
                }
            }
            c
        }
        pub fn matpow(&self, mut n: usize) -> Self {
            let mut t = Self::identity();
            let mut s = self.clone();
            while n > 0 {
                if n & 1 == 1 {
                    t = t.matmul(&s);
                }
                s = s.matmul(&s);
                n >>= 1;
            }
            t
        }
    }
}
// ---------- end Matrix ----------
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

// ここまで

use matrix::*;
use std::io::Write;

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

fn run() {
    input! {
        h: usize,
        w: usize,
        l: u32,
        r: u32,
    }
    let d = r - l + 1;
    let x = ModInt(d / 2);
    let y = ModInt(d) - x;
    let mut mat = SquareMatrix::<ModInt>::zero();
    mat.set_at(0, 0, y);
    mat.set_at(1, 1, y);
    mat.set_at(0, 1, x);
    mat.set_at(1, 0, x);
    let p = mat.matpow(h);
    let q = p.matpow(w);
    let a = q.get_at(0, 0);
    let b = q.get_at(1, 0);
    let mut ans = a;
    if h % 2 == 1 && w % 2 == 1 {
        ans += b;
    }
    println!("{}", ans);
}

fn main() {
    run();
}


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

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

    let mut it = input.split_whitespace();

    let k: i32 = it.next().unwrap().parse().unwrap();
    let n: i32 = it.next().unwrap().parse().unwrap();
    let s: i32 = it.next().unwrap().parse().unwrap();
    let p: i32 = it.next().unwrap().parse().unwrap();

    // For one person:
    // s * (ans - 1) < n <= s * ans
    // 0 < n - s * (ans - 1) <= s
    // 0 <= n - s * (ans - 1) - 1 < s
    // 0 <= n - 1 - s * (ans - 1) < s
    // ans - 1 = (n - 1) / s
    // ans = (n - 1) / s + 1
    let sn = (n - 1) / s + 1;
    // p * (ans - 1) < k * sn <= p * ans
    // 0 < k * sn - p * (ans - 1) <= p
    // 0 <= k * sn - 1 - p * (ans - 1) < p
    // ans - 1 = (k * sn - 1) / p
    let ans = (k * sn - 1) / p + 1;
    println!("{}", ans);
}


use std::io;
use std::io::prelude::*;
fn main() {
    let mut score = String::new();
    io::stdin().read_line(&mut score).expect("Error");
    if score.contains("1111111") || score.contains("0000000"){
        println!("YES");
    }
    else{
        println!("NO");
    }
}


struct FenwickTree {
    val: Vec<i64>,
}

impl FenwickTree {
    fn new(n: usize) -> Self {
        FenwickTree {
            val: vec![0; n + 1],
        }
    }
    fn add(&mut self, mut x: usize, v: i64) {
        while let Some(p) = self.val.get_mut(x) {
            *p += v;
            x += x & (!x + 1);
        }
    }
    fn sum(&mut self, mut x: usize) -> i64 {
        assert!(x < self.val.len());
        let mut ans = 0;
        while x > 0 {
            ans += self.val[x];
            x -= x & (!x + 1);
        }
        ans
    }
}

fn sieve(n: usize) -> Vec<i64> {
    let mut is_prime = vec![true; n + 1];
    for i in 2.. {
        if i * i > n {
            break;
        }
        if is_prime[i] {
            let mut j = i * i;
            while j <= n {
                is_prime[j] = false;
                j += i;
            }
        }
    }
    let len = is_prime.iter().skip(2).filter(|p| **p).count();
    let mut prime = Vec::with_capacity(len);
    for (i, is_prime) in is_prime.into_iter().enumerate().skip(2) {
        if is_prime {
            prime.push(i as i64);
        }
    }
    prime
}

struct PrimeCountSolver {
    query: Vec<i64>,
    memo: Vec<i64>,
}

impl PrimeCountSolver {
    fn new() -> Self {
        PrimeCountSolver {
            query: vec![],
            memo: vec![],
        }
    }
    fn add(&mut self, n: i64) {
        self.query.push(n);
    }
    fn build(&mut self) {
        self.query.sort();
        self.query.dedup();
        let n = self.query.last().map_or(1, |n| *n);
        let mut m = 1;
        while (m + 1) * (m + 1) <= n {
            m += 1;
        }
        let p = sieve(m as usize);
        let bound = (n as f64).cbrt().powi(2) as i64 + 2;
        let mut stack = vec![];
        for &v in self.query.iter() {
            let k = match p.binary_search_by(|&p| (p * p).cmp(&v)) {
                Ok(k) => k + 1,
                Err(k) => k,
            };
            stack.push((v, k));
        }
        let mut query = vec![];
        while let Some((n, k)) = stack.pop() {
            if k == 0 {
                continue;
            }
            let q = p[k - 1];
            if q * q > n {
                let x = match p[..k].binary_search_by(|&p| (p * p).cmp(&n)) {
                    Ok(k) => k + 1,
                    Err(k) => k,
                };
                stack.push((n, x));
            } else if n <= bound {
                query.push((k, n));
            } else {
                stack.push((n, k - 1));
                stack.push((n / q, k - 1));
            }
        }
        query.sort();
        query.dedup();
        let m = bound as usize;
        let mut bit = FenwickTree::new(m);
        for i in 1..=m {
            bit.add(i, 1);
        }
        let mut is_prime = vec![true; m + 1];
        let mut memo = vec![0; query.len()];
        let mut pos = 0;
        for (i, p) in p.iter().enumerate() {
            let p = *p as usize;
            let mut j = p;
            while j <= m {
                if is_prime[j] {
                    bit.add(j, -1);
                }
                is_prime[j] = false;
                j += p;
            }
            while let Some(&(k, n)) = query.get(pos) {
                if k > i + 1 {
                    break;
                } else {
                    memo[pos] = bit.sum(n as usize);
                    pos += 1;
                }
            }
            if pos >= query.len() {
                break;
            }
        }
        self.memo.clear();
        self.memo.resize(self.query.len(), 0);
        let mut stack = vec![];
        for (i, &n) in self.query.iter().enumerate() {
            let k = match p.binary_search_by(|&p| (p * p).cmp(&n)) {
                Ok(k) => k + 1,
                Err(k) => k,
            };
            self.memo[i] += k as i64 - 1;
            stack.push((n, k, 1, i));
        }
        while let Some((n, k, sign, i)) = stack.pop() {
            if k == 0 {
                self.memo[i] += sign * n;
                continue;
            }
            let q = p[k - 1];
            if q * q > n {
                let x = match p[..k].binary_search_by(|p| (p * p).cmp(&n)) {
                    Ok(k) => k + 1,
                    Err(k) => k,
                };
                self.memo[i] += -sign * (k - x) as i64;
                stack.push((n, x, sign, i));
            } else if n <= bound {
                self.memo[i] += sign * memo[query.binary_search(&(k, n)).unwrap()];
            } else {
                stack.push((n, k - 1, sign, i));
                stack.push((n / q, k - 1, -sign, i));
            }
        }
    }
    fn get(&self, n: i64) -> i64 {
        self.memo[self.query.binary_search(&n).unwrap()]
    }
}

fn run() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let n: i64 = s.trim().parse().unwrap();
    let p = sieve((n as f64).sqrt() as usize + 2);
    let mut ans = 0i64;
    for p in p.iter() {
        if p.pow(3) <= n {
            ans += 1;
        } else {
            break;
        }
    }
    let mut solver = PrimeCountSolver::new();
    for (i, p) in p.iter().enumerate() {
        if p.pow(2) <= n {
            ans -= i as i64 + 1;
            solver.add(n / *p);
        }
    }
    solver.build();
    for p in p.iter() {
        if p.pow(2) <= n {
            ans += solver.get(n / *p);
        }
    }
    println!("{}", ans);
}

fn main() {
    run();
}


use std::io;

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

    if n % 4 == 0 {
        println!("YES");
    } else if n % 7 == 0 {
        println!("YES");
    } else if n % 44 == 0 {
        println!("YES");
    } else if n % 47 == 0 {
        println!("YES");
    } else if n % 74 == 0 {
        println!("YES");
    } else if n % 77 == 0 {
        println!("YES");
    } else if n % 444 == 0 {
        println!("YES");
    } else if n % 447 == 0 {
        println!("YES");
    } else if n % 474 == 0 {
        println!("YES");
    } else if n % 477 == 0 {
        println!("YES");
    } else if n % 744 == 0 {
        println!("YES");
    } else if n % 747 == 0 {
        println!("YES");
    } else if n % 774 == 0 {
        println!("YES");
    } else if n % 777 == 0 {
        println!("YES");
    } else {
        println!("NO");
    }
}


fn main() {
    let mut sin = ReadIn::new();
    let a = sin.intvec();
    let s: i32 = a.iter().sum();
    let x = (0..64).any(|b| if count(b) != 3 { false } else {
        (0..6)
            .filter_map(|i| if b & (1 << i) != 0 { Some(a[i as usize]) } else { None })
            .sum::<i32>() * 2 == s
    });
    println!("{}", if x {"YES"} else {"NO"});
}

fn count(i: i32) -> i32 {
    if i == 0 { 0 } else { 1 + count(i & (i - 1)) }
}

use std::iter::*;
use std::str::SplitWhitespace;
use std::io::stdin;
use std::mem::forget;

pub struct ReadIn(pub String);

impl ReadIn {
    pub fn new() -> ReadIn { ReadIn(String::new()) }
    fn read_i32(s: &str) -> i32 { s.parse().unwrap() }
    pub fn read_line(&mut self) {
        self.0.clear();
        forget(stdin().read_line(&mut self.0));
    }
    pub fn ints(&mut self) -> Map<SplitWhitespace, fn(&str) -> i32> {
        self.read_line();
        self.0.split_whitespace().map(ReadIn::read_i32)
    }
    pub fn intvec(&mut self) -> Vec<i32> { self.ints().collect() }
    pub fn int(&mut self) -> i32 { self.ints().next().unwrap() }
    pub fn int2(&mut self) -> (i32, i32) {
        let mut it = self.ints();
        (it.next().unwrap(), it.next().unwrap())
    }

    pub fn int3(&mut self) -> (i32, i32, i32) {
        let mut it = self.ints();
        (it.next().unwrap(), it.next().unwrap(), it.next().unwrap())
    }
    pub fn int4(&mut self) -> (i32, i32, i32, i32) {
        let mut it = self.ints();
        (it.next().unwrap(), it.next().unwrap(), it.next().unwrap(), it.next().unwrap())
    }
}


#![allow(unused_imports)]
use std::io::{ self, Write };
use std::str::FromStr;
use std::cmp::{ min, max };
use std::collections::{ BinaryHeap, VecDeque };

#[allow(unused_macros)]
macro_rules! trace {
    ($var:expr) => {
        let _ = writeln!(&mut std::io::stderr(), ">>> {} = {:?}", stringify!($var), $var);
    };
    ($($args:expr),*) => {
        let _ = writeln!(&mut std::io::stderr(), ">>> {} = {:?}", stringify!($($args),*), ($($args),*));
    };
}

const M: usize = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let l: u64 = sc.cin();
    let r: u64 = sc.cin();
    let x: u64 = sc.cin();
    let y: u64 = sc.cin();
    let k: u64 = sc.cin();

    for b in x..(y + 1) {
        let a = k * b;
        if l <= a && a <= r {
            println!("YES");
            return;
        }
    }
    println!("NO");
}

#[allow(dead_code)]
struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
#[allow(dead_code)]
impl Scanner {
    fn new() -> Scanner { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn reserve(&mut self) {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
    }
    fn cin<T: FromStr>(&mut self) -> T {
        self.reserve();
        match self.buffer.pop_front().unwrap().parse::<T>() {
            Ok(a) => a,
            Err(_) => panic!("parse err")
        }
    }
    fn get_char(&mut self) -> char {
        self.reserve();
        let head = self.buffer[0].chars().nth(0).unwrap();
        let tail = String::from( &self.buffer[0][1..] );
        if tail.len()>0 { self.buffer[0]=tail } else { self.buffer.pop_front(); }
        head
    }
}


//================================================================================
#[allow(unused_imports)] use std::cmp::{max, min, Ordering};
#[allow(unused_imports)] use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)] use std::iter::FromIterator;
use std::io::Write;
static mut GLOBAL_STDIN: *mut std::io::Stdin = 0usize as _;
static mut GLOBAL_STDINLOCK: *mut std::io::StdinLock<'static> = 0usize as _;
static mut GLOBAL_STDOUT: *mut std::io::Stdout = 0usize as _;
static mut GLOBAL_STDOUTLOCK: *mut std::io::StdoutLock<'static> = 0usize as _;
const BUF_SIZE: usize = 1024*1024;
static mut GLOBAL_INPUT_BUF: *mut u8 = 0usize as _;
static mut GLOBAL_INPUT_PTR: *const u8 = 0usize as _;
static mut GLOBAL_INPUT_END: *const u8 = 0usize as _;
fn init() {
    unsafe {
        use std::boxed::Box;
        GLOBAL_STDIN = Box::into_raw(Box::new(std::io::stdin()));
        GLOBAL_STDINLOCK = Box::into_raw(Box::new(GLOBAL_STDIN.as_ref().unwrap().lock()));
        GLOBAL_STDOUT = Box::into_raw(Box::new(std::io::stdout()));
        GLOBAL_STDOUTLOCK = Box::into_raw(Box::new(GLOBAL_STDOUT.as_mut().unwrap().lock()));
        let buf = Box::<[u8]>::into_raw(vec![0u8; BUF_SIZE].into_boxed_slice());
        GLOBAL_INPUT_BUF = (*buf).as_mut_ptr();
        GLOBAL_INPUT_PTR = GLOBAL_INPUT_BUF;
        GLOBAL_INPUT_END = GLOBAL_INPUT_BUF;
    }
}
fn peek() -> u8 { unsafe {
    use std::io::Read;
    if GLOBAL_INPUT_PTR == GLOBAL_INPUT_END {
        let n = GLOBAL_STDINLOCK.as_mut().unwrap().read(std::slice::from_raw_parts_mut(GLOBAL_INPUT_BUF, BUF_SIZE)).expect("I/O error");
        GLOBAL_INPUT_PTR = GLOBAL_INPUT_BUF;
        GLOBAL_INPUT_END = GLOBAL_INPUT_PTR.offset(n as isize);
    }
    *GLOBAL_INPUT_PTR
} }
fn getchar() -> u8 { let c = peek(); unsafe { GLOBAL_INPUT_PTR = GLOBAL_INPUT_PTR.offset(1); } c }
fn ungetc() { unsafe { GLOBAL_INPUT_PTR = GLOBAL_INPUT_PTR.offset(-1); } }
fn skip_whitespaces() { loop { match getchar() as char { ' ' | '\t' | '\n' | '\r' => { }, _ => { ungetc(); break; } } } }
trait FastRead { fn read() -> Self; }
macro_rules! read_int_impl {
    ( $signed:expr, $($T:ident,)* ) => {
        $(impl FastRead for $T {
            fn read() -> $T {
                skip_whitespaces(); let is_negative = if $signed && peek() == '-' as u8 { getchar(); true } else { false }; let mut val: $T = 0;
                loop {
                    let c = getchar(); let d = c.wrapping_sub('0' as u8);
                    if d >= 10 { match c as char {
                        ' ' | '\t' | '\n' | '\r' => { ungetc(); return if is_negative { 0-val } else { val }; },
                        _ => panic!("invalid input character: `{}' (code: {})", c as char, c),
                    }}
                    val = 10*val + (d as $T);
                }
            }
        })*
    };
}
macro_rules! read_tuple_impl {
    ( ) => ();
    ( $a:ident, $($name:ident,)* ) => {
        impl<$a:FastRead, $($name:FastRead),*> FastRead for ($a, $($name,)*) { fn read() -> Self { ( $a::read(), $($name::read()),* ) } }
        read_tuple_impl!($($name,)*);
    }
}
macro_rules! snd_arg_impl { ($a:expr; $e:expr) => { $e }; }
macro_rules! read_array_impl {
    () => {};
    ($len:expr, $($lens:expr,)*) => {
        impl <T: FastRead> FastRead for [T; $len] { fn read() -> Self { [ $(snd_arg_impl!($lens; read::<T>())),* ] } }
        read_array_impl!($($lens,)*);
    };
}
unsafe fn extend_vec(v: &mut Vec<u8>, first: *const u8, last: *const u8) {
    let len = usize::wrapping_sub(last as _, first as _);
    v.extend_from_slice(&std::slice::from_raw_parts(first, len));
}
macro_rules! read_string_inplace {
    ($func:ident, $($pattern:pat)|+) => {
        #[allow(unused)] fn $func(s: &mut String) -> bool {
            skip_whitespaces();
            unsafe { let mut ptr = GLOBAL_INPUT_PTR; let end = GLOBAL_INPUT_END; let v = s.as_mut_vec(); v.clear();
                     loop {
                         if ptr == end { extend_vec(v, GLOBAL_INPUT_PTR, end); GLOBAL_INPUT_PTR = GLOBAL_INPUT_END; peek(); ptr = GLOBAL_INPUT_PTR; }
                         match *ptr as char {
                             $($pattern)|+ => { extend_vec(v, GLOBAL_INPUT_PTR, ptr); GLOBAL_INPUT_PTR = ptr; return v.is_empty(); }
                             _ => { ptr = ptr.offset(1); }
                         }
                     }
            }
        }
    };
}
read_string_inplace!(getword, ' ' | '\t' | '\n' | '\r');
read_string_inplace!(getline, '\n');
#[allow(unused)] fn read_line() -> String { let mut s = String::new(); getline(&mut s); s }
impl FastRead for String { fn read() -> String { let mut s = String::new(); getword(&mut s); s } }
impl FastRead for char { fn read() -> char { skip_whitespaces(); getchar() as char } }
read_int_impl!(false, u8, u16, u32, u64, usize,);
read_int_impl!(true,  i8, i16, i32, i64, isize,);
read_tuple_impl!(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,);
read_array_impl!(12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,);
#[allow(dead_code)] fn read<T: FastRead>() -> T { T::read() }
#[allow(unused_macros)] macro_rules! print   { ($($arg:tt)*) => { write!  (unsafe { GLOBAL_STDOUTLOCK.as_mut().unwrap() }, $($arg)*).unwrap() } }
#[allow(unused_macros)] macro_rules! println { ($($arg:tt)*) => { writeln!(unsafe { GLOBAL_STDOUTLOCK.as_mut().unwrap() }, $($arg)*).unwrap() } }
#[allow(dead_code)] fn read_vec<T: FastRead>(n: usize) -> Vec<T> { let mut v = Vec::with_capacity(n); for _ in 0..n { v.push(read()); } v }
#[allow(dead_code)] fn print_iter<I: Iterator<Item=T>, T: std::fmt::Display>(iter: I) { let mut iter = iter; if let Some(x) = iter.next() { print!("{}", x); for x in iter { print!(" {}", x); } } println!(""); }
#[allow(dead_code)] fn print_vec<T: std::fmt::Display>(v: &Vec<T>) { print_iter(v.iter()); }
#[allow(unused_macros)] macro_rules! debug { ($a:expr, $($b:expr),*) => (if cfg!(debug_assertions) { println!(concat!("DEBUG: ", stringify!($a), " = {:?}", $(", ", stringify!($b), " = {:?}"),*), $a, $($b),*); } ) }
//================================================================================

fn main() {
    init();
    let n: u64 = read();
    let mut k=1u64;
    while (1u64<<k)-1 < n {
        k += 1;
    }
    println!("{}", k);
}


fn read_line() -> String {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).expect("EOF");
    line.pop();
    return line;
}

macro_rules! read_line {
    (Vec<$t: ty>) => {{
        read_line().split_whitespace().map(|token| {
            <$t as std::str::FromStr>::from_str(token).expect("Invalid token")
        }).collect<Vec<$t>>()
    }};
    ($($t: ty),*) => {{
        let line = read_line();
        let mut iter = line.split_whitespace();
        ($({
            let token = iter.next().expect("Too few tokens");
            <$t as std::str::FromStr>::from_str(token).expect("Invalid token")
        }), *)
    }};
}

use std::cmp;

fn main() {
    let (n, k) = read_line!(i32, i32);
    let x = cmp::min(k * 2, n - k);
    let y = if k == 0 { 0 } else { cmp::min(1, n - k) };
    println!("{} {}", y, x);
}


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

    let v = {
        let mut v = vec![];
        for _ in 0..n {
            let mut buf = String::new();
            std::io::stdin().read_line(&mut buf).unwrap();
            let mut ws = buf.split_whitespace();
            let a: usize = ws.next().unwrap().parse().unwrap();
            let b: usize = ws.next().unwrap().parse().unwrap();
            v.push((a, b));
        }
        v
    };

    let mut ans = 0;
    for i in 0..n {
        for j in 0..n {
            if i == j {
                continue;
            }
            if v[i].0 == v[j].1 {
                ans += 1;
            }
        }
    }

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


use std::io;

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

fn is_prime(n: u32) -> bool {
    let mut i = 2;
    while i * i <= n {
        if n % i == 0 {
            return false;
        }
        i += 1;
    }
    true
}

fn main() {
    let n = read();
    for m in 1..1001 {
        if !is_prime(n * m + 1) {
            println!("{}", m);
            break;
        }
    }
}


// https://codeforces.com/contest/1118/problem/D2
//
#![allow(unused_imports)]
use std::io::*;
use std::io::Write;
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 isok(days: usize, a: &Vec<i64>) -> i64 {
    let n = a.len();
    let mut total = 0;
    let mut cup = 0;
    let mut fr = 0;
    while fr < n {
        for i in 0..days {
            if fr == n {
                break;
            }
            total += max(0, a[fr]-cup);
            fr += 1;
        }
        cup += 1;
    }
    total
}

fn main() {
    input! {
        n: usize, m: i64,
        mut a: [i64; n]
    };
    a.sort();
    a.reverse();

    let mut sum = 0;
    for i in 0..n {
        sum += a[i];
    }
    if sum < m {
        println!("-1");
        return;
    }

    let mut ng = 0;
    let mut ok = n;
    while ok - ng > 1 {
        let med = (ok + ng) / 2;
        if isok(med, &a) >= m {
            ok = med;
        } else {
            ng = med;
        }
    }
    println!("{}", ok);
}


// use rand::Rng;

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

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

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

fn main() {
    let a = split_input!(u64);
    let l = a[1] - a[0] + 1;
    if l < 3 || l == 3 && a[1] & 1 > 0 {
        println!("-1");
    } else {
        let mut s = a[0];
        if s & 1 == 1 {
            s += 1;
        }
        println!("{} {} {}", s, s + 1, s + 2);
    }
}


#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(dead_code)]

#[allow(unused_macros)]
macro_rules! invec {
    ( $ t : ty ) => {{
        let mut s = String::new();
        match std::io::stdin().read_line(&mut s) {
            Ok(0) => Vec::<$t>::new(),
            Ok(n) => s
                .trim()
                .split_whitespace()
                .map(|s| s.parse::<$t>().unwrap())
                .collect::<Vec<$t>>(),
            Err(_) => Vec::<$t>::new(),
        }
    }};
}

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

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut 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)*}
    };
    ($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<_>>()
    };

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

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

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

#[allow(unused_macros)]
#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    //($arg:expr) => (println!("{:?}",$arg));
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
}
#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}

macro_rules! echo {
    ($($a:expr),*) => {
          $(println!("{}",$a))*
      }
}

use std::cmp::*;
use std::collections::*;
use std::ops::{Add, Div, Mul, Sub};

#[allow(dead_code)]
static INF_I64: i64 = i64::max_value() / 2;
#[allow(dead_code)]
static INF_I32: i32 = i32::max_value() / 2;
#[allow(dead_code)]
static INF_USIZE: usize = usize::max_value() / 2;
#[allow(dead_code)]
static M_O_D: usize = 1000000007;
#[allow(dead_code)]
static PAI: f64 = 3.1415926535897932;

trait IteratorExt: Iterator {
    fn toVec(self) -> Vec<Self::Item>;
}

impl<T: Iterator> IteratorExt for T {
    fn toVec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

trait CharExt {
    fn toNum(&self) -> usize;
    fn toAlphabetIndex(&self) -> usize;
    fn toNumIndex(&self) -> usize;
}
impl CharExt for char {
    fn toNum(&self) -> usize {
        return *self as usize;
    }
    fn toAlphabetIndex(&self) -> usize {
        return self.toNum() - 'a' as usize;
    }
    fn toNumIndex(&self) -> usize {
        return self.toNum() - '0' as usize;
    }
}

trait VectorExt {
    fn joinToString(&self, s: &str) -> String;
}
impl<T: ToString> VectorExt for Vec<T> {
    fn joinToString(&self, s: &str) -> String {
        return self
            .iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join(s);
    }
}

trait StringExt {
    fn get_reverse(&self) -> String;
}
impl StringExt for String {
    fn get_reverse(&self) -> String {
        self.chars().rev().collect::<String>()
    }
}

trait UsizeExt {
    fn pow(&self, n: usize) -> usize;
}
impl UsizeExt for usize {
    fn pow(&self, n: usize) -> usize {
        return ((*self as u64).pow(n as u32)) as usize;
    }
}

fn main() {
    let (a, b, c) = get!(i64, i64, i64);
    let mut k = vec![];
    for i in 0..100 {
        k.push((b * ((i as i64).pow(a as u32)) + c, i));
    }
    let mut ans = vec![];
    for &(d, e) in &k {
        if d <= 0 {
            continue;
        } else if d > 10_i64.pow(9) {
            continue;
        }
        let f = d
            .to_string()
            .chars()
            .map(|x| x as usize - '0' as usize)
            .fold(0, |a, x| a + x);
        if f == e {
            ans.push(d);
        }
    }
    echo!(ans.len());
    echo!(ans.joinToString(" "));
}


use std::io;

macro_rules! except {
    ($result: expr) => {
        match $result {
            Err(e) => panic!("{}", e),
            Ok(m) => m,
        }
    };
    ($result: expr, $msg: expr) => {
        match $result {
            Err(e) => panic!("{}: {}", $msg, e),
            Ok(m) => m,
        }
    };
}

fn parse_line() -> Vec<u8> {
    let mut input = String::new();
    except!(io::stdin().read_line(&mut input));
    input.trim().split_whitespace()
       .map(|x| except!(x.parse::<u8>()))
       .collect()
}

fn main() {
    let n = parse_line()[0] as usize;
    let a = parse_line();
    if n > a.len() {
        println!("0");
        return
    }
    let mut counts = a.iter().fold([0u8; 101], |mut v, &x| {v[x as usize] += 1; v});
    counts.sort_unstable_by(|x, y| y.cmp(x));
    let mut nums = vec![0u8; n];
    for _ in 0..n {
        let (index, _) = nums.iter().enumerate()
            .max_by_key(|&(i, v)| counts[i] / (v + 1)).unwrap();
        nums[index] += 1;
    }
    let (index, _) = nums.iter().enumerate().filter(|&(_, v)| *v != 0)
        .min_by_key(|&(i, v)| counts[i] / v).unwrap();
    println!("{}", counts[index] / nums[index]);
}


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

macro_rules! scan_line {
    () => ({
        let stdin = io::stdin();
        let mut handle = stdin.lock();
        let mut buffer = String::new();
        handle.read_line(&mut buffer)
            .expect("scan_line: failed at `handle.read_line`.");
        buffer
    });
    ( $($t:ty)+ ) => ({
        let stdin = io::stdin();
        let mut handle = stdin.lock();
        let mut buffer = String::new();
        handle.read_line(&mut buffer)
            .expect("scan_line: failed at `handle.read_line`.");
        let mut chunks = buffer.split_whitespace();

        ($(
            {
                chunks.next()
                    .expect("scan_line: failed at `next`, # of space separated strings not equal to requested #")
                .parse::<$t>()
                    .expect("scan_line: failed at `parse::<$t>`.")
            },
        )+)
    })
}

fn main() {
    let (n, k, t) = scan_line!(i64 i64 i64);

    if t <= k {
        println!("{}", t);
    } else if t <= n {
        println!("{}", k);
    } else {
        let d = k - (t - n);
        println!("{}", d);
    }
}


use std::io;

fn contains(n: &String, sub: &String) -> bool {
    let mut chars = sub.chars();
    let mut now = chars.next();
    for c in n.chars() {
        if let Some(nowc) = now {
            if nowc == c {
                now = chars.next();
            }
        } else {
            break;
        }
    }
    return now == None;
}

fn main() {
    let mut n = String::new();
    io::stdin().read_line(&mut n);
    n = n.trim().to_string();
    let n_len = n.chars().count();
    for k in (1..44722).rev() {
        let sub = (k * k).to_string();
        let sub_len = sub.chars().count();
        if n_len >= sub_len && contains(&n, &sub) {
            println!("{}", n_len - sub_len);
            return;
        }
    }
    println!("-1");
}


// ---------- 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: 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)
        }
    }

    #[allow(dead_code)]
    pub fn mod_pow(r: u64, mut n: u64, m: u64) -> u64 {
        let mut t = 1 % m;
        let mut s = r % m;
        while n > 0 {
            if n & 1 == 1 {
                t = t * s % m;
            }
            s = s * s % m;
            n >>= 1;
        }
        t
    }
}
// ---------- 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 ----------
//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")
    };
}

//

use modint::*;
use precalc::*;

type M = ModInt<Mod>;

fn run() {
    input! {
        p: u64,
        k: u64,
    }
    let ans = if k == 0 {
        M::from(p).pow(p - 1)
    } else if k == 1 {
        M::from(p).pow(p)
    } else {
        let mut phi = p - 1;
        let mut m = phi;
        for d in 2.. {
            if d * d > m {
                break;
            }
            if m % d == 0 {
                while m % d == 0 {
                    m /= d;
                }
                while phi % d == 0 && mod_pow(k, phi / d, p) == 1 {
                    phi /= d;
                }
            }
        }
        if m > 1 && mod_pow(k, phi / m, p) == 1 {
            phi /= m;
        }
        M::from(p).pow((p - 1) / phi)
    };
    println!("{}", ans);
}

fn main() {
    run();
}


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

fn find_div(x: usize) -> Vec<usize> {
    let mut result = Vec::new();
    for i in 1..=x {
        if x % i == 0 {
            result.push(i);
        }
    }
    return result;
}

fn _main() {
    let mut scan = Scan::new();
    let n: usize = scan.next();
    let mut arr: Vec<usize> = scan.next_n(n);
    let x = *arr.iter().max().unwrap();
    let div_x = find_div(x);
    for &item in div_x.iter() {
        *arr.iter_mut().find(|x| **x == item).unwrap() = 0;
    }
    let y = *arr.iter().max().unwrap();
    println!("{} {}", x, y);
}

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


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

macro_rules! scan_line {
    () => ({
        let stdin = io::stdin();
        let mut handle = stdin.lock();
        let mut buffer = String::new();
        handle.read_line(&mut buffer)
            .expect("scan_line: failed at `handle.read_line`.");
        buffer
    });
    ( $($t:ty)+ ) => ({
        let stdin = io::stdin();
        let mut handle = stdin.lock();
        let mut buffer = String::new();
        handle.read_line(&mut buffer)
            .expect("scan_line: failed at `handle.read_line`.");
        let mut chunks = buffer.split_whitespace();

        ($(
            {
                chunks.next()
                    .expect("scan_line: failed at `next`, # of space separated strings not equal to requested #")
                .parse::<$t>()
                    .expect("scan_line: failed at `parse::<$t>`.")
            },
        )+)
    })
}

fn main() {
    let (mut n, ) = scan_line!(i64);

    n -= 3;
    let mut numerator = 1;
    let mut denominator = 2;

    while n >= 1 {
        if numerator + 1 < denominator {
            numerator += 1;
        } else {
            denominator += 1;
        }
        n -= 1;
    }

    let primes = vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101];

    loop {
        if numerator == 1 { break; }
        let mut good = true;
        for p in primes.iter() {
            if denominator % *p == 0 && numerator % *p == 0 {
                denominator += 1;
                numerator -= 1;
                good = false;
                break;
            }
        }
        if good { break; }
    }

    println!("{} {}", numerator, denominator);
}


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 div_and_ceil(a: i32, b: i32) -> i32 {
    if a % b == 0 { a / b } else { a / b + 1 }
}

fn main() {
    let (guests, lists) = readln!(i32, i32);

    let red = div_and_ceil(2 * guests, lists);
    let green = div_and_ceil(5 * guests, lists);
    let blue = div_and_ceil(8 * guests, lists);

    println!("{}", red + green + blue);
}


use std::error::Error;
use std::io;
use std::process;

fn main() {
    if let Err(e) = run() {
        println!("{}", e);
        process::exit(1);
    }
}

fn run() -> Result<(), Box<Error>> {
    let mut n = String::new();
    io::stdin().read_line(&mut n)?;
    let mut n: usize = n.trim().parse()?;
    let mut a = String::new();
    io::stdin().read_line(&mut a)?;
    let mut a: Vec<&str> = a
        .trim()
        .split(" ")
        .collect();
    let mut cur = 0;
    let mut pre = 0;
    let mut inc = false;
    let mut con = false;
    let mut dec = false;
    for i in 0..n {
        if i == 0 {
            cur = a[i].parse()?;
            continue;
        }
        pre = cur;
        cur = a[i].parse()?;
        if pre < cur {
            if con || dec {
                println!("NO");
                return Ok(());
            }
            inc = true;
        } else if pre == cur {
            if dec {
                println!("NO");
                return Ok(());
            }
            con = true;
        } else {
            dec = true;
        }
    }
    println!("YES");
    Ok(())
}


// ---------- 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;
use std::collections::*;

type Map<K, V> = BTreeMap<K, V>;
type Set<T> = BTreeSet<T>;
type Deque<T> = VecDeque<T>;

fn run() {
    input! {
        t: usize,
        ask: [(usize, usize, usize); t],
    }
    let out = std::io::stdout();
    let mut out = std::io::BufWriter::new(out.lock());
    for (h, w, k) in ask {
        let b = k;
        let a = h * w / 2 - b;
        let ans = match (h % 2, w % 2, a % 2, b % 2) {
            (0, 0, 0, 0) => "YES",
            (0, 0, _, _) => "NO",
            (0, 1, _, 0) if b <= (w - 1) * h / 2 => "YES",
            (0, 1, _, _) => "NO",
            (1, 0, 0, _) if a <= (h - 1) * w / 2 => "YES",
            _ => "NO",
        };
        writeln!(out, "{}", ans).ok();
    }
}

fn main() {
    run();
}


use std::io::*;

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

    println!("{}", (s.len() + s[1..].contains("1") as usize) / 2);
}


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

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

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

//

fn can(m: usize, a: &[usize], p: &[(usize, usize)]) -> bool {
    let mut last = m;
    let mut free = 0;
    let mut rem = vec![];
    rem.extend_from_slice(a);
    for &(d, t) in p.iter().rev() {
        if d > m {
            continue;
        }
        if last > d {
            free += last - d;
            last = d;
        }
        while rem[t] > 0 && last > 0 {
            rem[t] -= 1;
            last -= 1;
        }
    }
    free += last;
    2 * rem.into_iter().fold(0, |s, a| s + a) <= free
}

fn run() {
    input! {
        n: usize,
        m: usize,
        a: [usize; n],
        p: [(usize, usize1); m],
    }
    let mut p = p;
    p.sort_by_key(|p| p.0);
    let mut ng = 0;
    let mut ok = 400_000;
    while ok - ng > 1 {
        let m = (ok + ng) / 2;
        if can(m, &a, &p) {
            ok = m;
        } else {
            ng = m;
        }
    }
    println!("{}", ok);
}

fn main() {
    run();
}


static PERMS: [[usize; 8]; 3] = [
    [2, 4, 6, 8, 10, 12, 23, 21],
    [13, 14, 5, 6, 17, 18, 21, 22],
    [3, 4, 17, 19, 10, 9, 16, 14]
];

fn shiftmod(i: usize, dir: i32) -> usize {
    let res = i as i32 + 2 * dir;
    (if res < 0 { 8 + res } else if res > 8 { res - 8 } else { res }) as usize
}

struct State(Vec<i32>);

impl State {
    fn shift(&mut self, perm: &[usize; 8], dir: i32) {
        for i in 0..6 {
            self.0.swap(perm[i] - 1, perm[shiftmod(i, dir)] - 1)
        }
    }

    fn is_correct(&self) -> bool {
        (0..6).all(|i|
            ((i * 4)..(i * 4 + 3))
                .all(|k| self.0[k] == self.0[k + 1]))
    }

    fn try_move(&mut self, perm: &[usize; 8], dir: i32) -> bool {
        self.shift(perm, dir);
        let res = self.is_correct();
        self.shift(perm, -dir);
        res
    }

    fn single_move(&mut self) -> bool {
        PERMS.iter().any(|perm| {
            self.try_move(perm, 1) || self.try_move(perm, -1)
        })
    }
}

fn main() {
    let mut sin = ReadIn::new();
    let mut colors = State(sin.intvec());
    println!("{}", if colors.single_move() { "YES" } else { "NO" });
}

use std::iter::*;
use std::str::SplitWhitespace;
use std::io::stdin;
use std::mem::forget;

pub struct ReadIn(pub String);

impl ReadIn {
    pub fn new() -> ReadIn { ReadIn(String::new()) }
    fn read_i32(s: &str) -> i32 { s.parse().unwrap() }
    pub fn read_line(&mut self) {
        self.0.clear();
        forget(stdin().read_line(&mut self.0));
    }
    pub fn ints(&mut self) -> Map<SplitWhitespace, fn(&str) -> i32> {
        self.read_line();
        self.0.split_whitespace().map(ReadIn::read_i32)
    }
    pub fn intvec(&mut self) -> Vec<i32> { self.ints().collect() }
    pub fn int(&mut self) -> i32 { self.ints().next().unwrap() }
    pub fn int2(&mut self) -> (i32, i32) {
        let mut it = self.ints();
        (it.next().unwrap(), it.next().unwrap())
    }

    pub fn int3(&mut self) -> (i32, i32, i32) {
        let mut it = self.ints();
        (it.next().unwrap(), it.next().unwrap(), it.next().unwrap())
    }
    pub fn int4(&mut self) -> (i32, i32, i32, i32) {
        let mut it = self.ints();
        (it.next().unwrap(), it.next().unwrap(), it.next().unwrap(), it.next().unwrap())
    }
}


#![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 main() {
    //let t:usize = read();

    //'outer: for _ in 0..t {
        let n:usize = read();
        let mut a:Vec<i64> = (0..n).map(|_| read()).collect();
        a.reverse();
        let mut v = vec![];
        for i in 0..n {
            let mut f = false;
            for j in 0..v.len() {
                if a[i] == v[j] {
                    f = true;
                }
            }
            if !f {
                v.push(a[i]);
            }
        }
        v.reverse();
        println!("{}",v.len());
        for e in v {print!("{} ",e);} println!();
    //}
}

/*

*/


use std::cmp;
use std::error::Error;
use std::io::{self, Read};

fn main() -> Result<(), Box<Error>> {
    let mut stdin = io::stdin();
    let mut line = String::new();
    stdin.read_line(&mut line)?;
    let num_digits: usize = line.trim().parse()?;
    let mut digits = vec![0u8; num_digits];
    stdin.read_exact(&mut digits)?;
    let num_eights = digits.iter().filter(|c| **c == b'8').count();
    println!("{}", cmp::min(num_digits / 11, num_eights));
    Ok(())
}