object Main extends App {
  val scanner = new java.util.Scanner(System.in)

  val data = Iterator.continually {
    val x = scanner.nextInt
    val y = scanner.nextInt

    (x, y)
  }.takeWhile(t => !(t._1 == 0 && t._2 == 0)).toList

  val outputs = data.map {
    case (x, y) =>
      if(x < y) {
        s"$x $y"
      } else {
        s"$y $x"
      }
  }

  outputs.foreach(println)
}