import scala.collection.mutable._ object KyoPRO{ implicit class Swap[T](v:Seq[T]) { def swap(i:Int,j:Int):Unit = { val t=v(i) v(i)=v(j) v(j)=t } } } import KyoPRO._ object Main { def main(A:Array[String])={ val s = new java.util.Scanner(System.in) val n=s.nextInt val a=Array.fill(n)(s.nextInt) for(i<-0 to n*2-4){ for(j<-(0 to n-2).takeWhile(j=>ja(i-j)) a.seq.swap(j,i-j) } } println(a mkString " ") } }