object Main{
	def main(args: Array[String]):Unit={
		loop()
	}
	def compale():String={
		val input = io.StdIn.readLine split " "
		val (a,b) = (input(0).toInt,input(1).toInt)
		if(a < b)
			return a.toString+" "+b.toString
		else if( a==0 && b==0 )
			return "quit"
		else
			return b.toString+" "+a.toString
	}
	def loop():Unit={
		val result=compale
		if(result!="quit"){
			println(result)
			loop()
		}
	}
}