import java.util.Scanner

import scala.collection.mutable.ListBuffer
import scala.util.control.Breaks

object Main {
  def main (args: Array[String]) = {
        val in = new Scanner(System.in)
        var list = new ListBuffer[String]

        val brk = new Breaks
        brk.breakable {
          while (true) {
            val first = in.nextInt
            val second = in.nextInt
            if (0 != first || 0 != second) {
              val great = Math.max(first, second)
              val less = Math.min(first, second)
              list += less + " " + great
            } else brk.break()
          }
        }

        list.foreach(println(_))
  }
}