fn main() { let mut buf = String::new(); let mut input = { use std::io::Read; std::io::stdin().read_to_string(&mut buf).unwrap(); buf.split_whitespace() }; let n: usize = input.next().unwrap().parse().unwrap(); let m: usize = input.next().unwrap().parse().unwrap(); let x: Vec = (0..n) .map(|_| input.next().unwrap().parse().unwrap()) .collect(); let mut y: Vec = (0..m) .map(|_| input.next().unwrap().parse().unwrap()) .collect(); y.sort(); for i in 0..n { if let Some(&y_target) = y.iter().filter(|&&y_j| y_j > x[i]).nth(0) { println!("{}", y_target - x[i]); } else { println!("Infinity"); } } }