
import scala.util.control.Breaks
object Main extends App {
  val b = new Breaks
  b.breakable {
    for (i <- 1 to 3000) {
      val Seq(x, y) = readLine().split(' ').map(_.toInt).toList.sorted
      if (x != 0 || y != 0)
        println("%d %d".format(x, y))
      else
        b.break
    }
  }
}
