import scala.collection.JavaConverters._

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

  val data = scanner.map { x =>
    val y = scanner.next
    (x.toInt, y.toInt)
  }.takeWhile(t => !(t._1 == 0 && t._2 == 0)).toList

  data.foreach {
    case (x, y) =>
      val result = if(x < y) {
          s"$x $y"
        } else {
          s"$y $x"
        }
      println(result)
  }
}