use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let m: usize = itr.next().unwrap().parse().unwrap(); let l: Vec = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let mut b: Vec = vec![0; 200020]; for i in 0..n { b[l[i]] += 1; } let mut out = Vec::new(); for i in 1..m + 1 { writeln!(out, "{} {}", i, b[i]).ok(); } stdout().write_all(&out).unwrap(); }