#[allow(unused_imports)] use std::cmp::*; #[allow(unused_imports)] use std::collections::*; fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec() -> Vec { read::() .split_whitespace() .map(|e| e.parse().ok().unwrap()) .collect() } fn grundy(m: usize, mem: &mut Vec) -> i32 { if mem[m] != -1 { return mem[m]; } let mut s = BTreeSet::new(); if m > 1 { s.insert(mem[m - 2]); } else { s.insert(mem[m - 1]); } if m > 2 { for i in 0..m - 3 + 1 { s.insert(mem[i] ^ mem[m - i - 3]); } } let mut res = 0; while s.contains(&res) { res += 1; } mem[m] = res; res - 1 } fn main() { let n: usize = read(); let mut a: Vec = read_vec(); a.sort(); let mut mountains = Vec::new(); mountains.push(1); for i in 1..n { if a[i] == a[i - 1] + 1 { let last_elem = mountains.len() - 1; mountains[last_elem] += 1; } else { mountains.push(1); } } let max_elem = *mountains.iter().max().unwrap(); let mut mem = vec![-1; max_elem + 1]; mem[0] = 0; // println!("{:?}", mountains); // println!("{:?}", mem); for m in 0..max_elem + 1 { grundy(m, &mut mem); } let result = mountains.iter().fold(0, |s, &x| s ^ mem[x]); if result == 0 { println!("Second"); } else { println!("First"); } }