object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val x = List.fill(n)(sc.nextInt())
  for (i <- 1 to n){
    println(x.zipWithIndex.filter(_._2!=(i-1)).map(_._1).sorted.apply(n/2-1))
  }
}