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 mut a: Vec = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); for i in 1..2 * n - 3 { for p in 0..i { let q = i - p; if p < q && q < n && a[p] > a[q] { a.swap(p, q); } } } let mut out = Vec::new(); for i in 0..n { write!(out, "{}", a[i]).ok(); if i != n - 1 { write!(out, " ").ok(); } } writeln!(out, "").ok(); stdout().write_all(&out).unwrap(); }