fun main(args: Array<String>) {
    var list = readLine()!!.split(" ").map { it.toInt() }
    while(list[0] != 0 || list[1] != 0) {
        val x = when {
            list[0] > list[1] -> "${list[1]} ${list[0]}"
            list[0] < list[1] -> "${list[0]} ${list[1]}"
            else -> "${list[0]} ${list[1]}"
        }
        println(x)
        list = readLine()!!.split(" ").map { it.toInt() }
    }
}
