import scala.collection.mutable.ListBuffer
import scala.io.StdIn

object Main extends App {
  var continue = true
  var result = ListBuffer.empty[String]
  while(continue){
    val Array(x, y) = StdIn.readLine().trim.split(' ').map(_.toInt)
    continue = if(x == 0 && y == 0) {
      false
    } else {
      result += (if(x > y) f"$y $x%n" else f"$x $y%n")
      true
    }
  }
  
  print(result.map(p => p).mkString("").dropRight(1))
}

