// OEIS A002187 https://oeis.org/A002187 use std::io::*; use std::str::*; fn readw(s: &mut R) -> Option { let s = s.bytes().map(|c| c.unwrap() as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect::(); if s.is_empty() { None } else { s.parse::().ok() } } const MAX_N: usize = 1000; fn read(s: &mut R) -> T { readw(s).unwrap_or_else(|| std::process::exit(0)) } fn grundy(n: u32, dp: &mut Vec>) -> u32 { if n < 340 { grundy_rec(n, dp) } else { grundy_rec((n - 340) % 34, dp) } } fn grundy_rec(n: u32, dp: &mut Vec>) -> u32 { if let Some(res) = dp[n as usize] { res } else { let res = if n == 1 || n == 0 { n } else { let mut s = vec![false; MAX_N]; s[grundy_rec(n - 2, dp) as usize] = true; for i in 0..n-2 { s[(grundy_rec(i, dp) ^ grundy_rec(n - 3 - i, dp)) as usize] = true; } (0..MAX_N).find(|&x| !s[x]).unwrap() as u32 }; dp[n as usize] = Some(res); // println!("{} {}", n, res); res } } fn solve() { // let mut dp = vec![None; 100]; // for i in 1..100 { // print!("{}, ", grundy(i, &mut dp)); // } let s = stdin(); let s = s.lock(); let s = &mut BufReader::new(s); loop { let n: usize = read(s); let mut a: Vec = (0..n).map(|_| read(s)).collect(); a.sort(); let mut g = 0; let mut dp = vec![None; n + 1]; let mut i = 0; while i < n { let mut j = i; while j + 1 < n && a[j + 1] == a[j] + 1 { j += 1; } // [i,j] let k = j - i + 1; g ^= grundy(k as u32, &mut dp); i = j + 1; } println!("{}", if g == 0 { "Second" } else { "First" }); } } fn main() { let stack_size = 104_857_600; // 100 MB let thd = std::thread::Builder::new().stack_size(stack_size); thd.spawn(solve).unwrap().join().unwrap(); }