use std::{ collections::BTreeMap, io::{stdout, BufWriter, Read, Write}, }; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let v: Vec<_> = s.split_whitespace().skip(2).collect(); let mut h = BTreeMap::new(); for x in v.chunks(2) { h.insert(x[0], x[1]); } let mut w = BufWriter::new(stdout()); for (k, v) in h.iter() { writeln!(w, "{} {}", k, v).ok(); } }