#[allow(unused_imports)] use std::cmp::{min,max}; #[allow(unused_imports)] use std::collections::BTreeMap; #[allow(unused_imports)] use std::ops::*; #[allow(unused_imports)] use std::collections::BinaryHeap; #[allow(unused_macros)] macro_rules! tf { ($c:expr, $t:expr, $f:expr) => {{ if $c { $t } else { $f } }}; } fn is_prime(x: i64) -> bool { if x <= 1 { return false; } for i in 2i64.. { if i * i > x { break; } if x % i == 0 { return false; } } true } fn main() { assert_eq!(is_prime(2), true); assert_eq!(is_prime(3), true); assert_eq!(is_prime(4), false); assert_eq!(is_prime(5), true); assert_eq!(is_prime(6), false); assert_eq!(is_prime(7), true); let (y,x) = { let xs = read_vec_i64(); (xs[0], xs[1]) }; assert!( 1 <= y && y <= 1_000_000_000 ); assert!( 1 <= x && x <= 1_000_000_000 ); assert!( 1 <= y && y <= 1_000_000_000 ); assert!( 1 <= x && x <= 2 ); if is_prime(y) && is_prime(x) { println!("Second"); return; } let y2 = { let mut res = y; for i in y+1.. { if is_prime(i) { res = i; break; } } res }; let x2 = { let mut res = x; for i in x+1.. { if is_prime(i) { res = i; break; } } res }; eprintln!("{}, {}", y2, x2); println!("{}", tf!(((y2-y)+(x2-x)) % 2 != 0, "First", "Second")); } #[allow(dead_code)] fn read_line() -> String { let mut ret = String::new(); std::io::stdin().read_line(&mut ret).ok(); ret.pop(); return ret; } #[allow(dead_code)] fn read_i64() -> i64 { let ss = read_line(); return ss.parse::().unwrap(); } #[allow(dead_code)] fn read_vec_i64() -> Vec { let mut res = vec![]; let ss = read_line(); for ts in ss.split_whitespace() { let x = ts.parse::().unwrap(); res.push(x); } return res; } use std::fmt::Display; #[allow(dead_code)] fn write_vec(xs: &Vec) { if xs.len() == 0 { println!(""); return; } print!("{}", xs[0]); for i in 1..xs.len() { print!(" {}", xs[i]); } println!(""); }