import scala.io.StdIn.readLine

object Main extends App {

  val xs = {
    val lines = Iterator.continually(readLine())
    val xs    = for {
      line       <- lines
      Array(x, y) = line.split(" ").map { _.toInt }
    } yield (x, y)

    xs.takeWhile { _ != (0, 0) }
  }

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

  results.foreach(println)
}

