object Main {
    import scala.annotation.tailrec

    def main(args: Array[String]) = {
        val sc = new java.util.Scanner(System.in)

        output(sc)
    }

    @tailrec
    def output(scanner: java.util.Scanner): Unit = {
        val x, y = scanner.nextInt

        if( x != 0 || y != 0 ) {
            println(if( x < y ) x + " " + y else y + " " + x)
            output(scanner)
        }
    }

}

