use std::io::Read; use std::io::Write; fn run() { let out = std::io::stdout(); let mut out = std::io::BufWriter::new(out.lock()); let mut s = String::new(); std::io::stdin().read_to_string(&mut s).unwrap(); let mut it = s.trim().split_whitespace(); it.next(); let m: usize = it.next().unwrap().parse().unwrap(); let mut cnt = vec![0; m + 1]; for s in it { let k: usize = s.parse().unwrap(); cnt.get_mut(k).map(|p| *p += 1); } for (i, c) in cnt.into_iter().enumerate().skip(1) { writeln!(out, "{} {}", i, c).ok(); } } fn main() { run(); }