import scala.io.StdIn

object Main extends App {
  
  def loop(x: Int, y: Int): Unit = {
    if(x != 0 || y != 0){
      if(x <= y) println(s"$x $y")
      else println(s"$y $x")

      val Array(nextx, nexty) = StdIn.readLine().trim.split(' ').map(_.toInt)
      loop(nextx, nexty)
    } 
  }

  val Array(fx, fy) = StdIn.readLine().trim.split(' ').map(_.toInt)

  loop(fx, fy)

}
