use std::{collections::HashMap, io::Read}; fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let x: i16 = s .trim() .split(' ') .flat_map(str::parse) .collect::>()[1]; s.clear(); std::io::stdin().read_to_string(&mut s).ok(); let mut h = HashMap::new(); s.trim().split('\n').for_each(|s| { let n: Vec = s.split(' ').flat_map(str::parse).collect(); let v = h.entry(n[0]).or_insert(n[1]); *v = n[1].max(*v); }); let a = (1..=x) .map(|i| { h.iter() .map(|(a, b)| b - (a - i).abs()) .max() .unwrap() .to_string() }) .collect::>() .join(" "); println!("{}", a) }