use std::io;
fn main() {
    let nm = input_nums();
    let (_n, _m) = (nm[0], nm[1]);
    let x = input_nums();
    let mut y = input_nums();
    let mut xstep: Vec<i32> = Vec::new();
    y.sort();

    for xi in &x {
        xstep.push(get_step(*xi, &y));
    }

    for step in xstep {
        if step == -1 {
            println!("Infinity");
        } else {
            println!("{}", step);
        }
    }
}

fn get_step(x: i32, y: &Vec<i32>) -> i32 {
    for yi in y {
        if *yi >= x {
            return *yi - x;
        }
    }
    -1
}

fn input_nums() -> Vec<i32> {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    let mut v = Vec::new();
    for n in s.split_whitespace() {
        v.push(n.parse().unwrap());
    }
    v
}