import scala.collection.mutable.ListBuffer
import scala.io.StdIn

object Main extends App {
  var continue = true
  var result = ListBuffer.empty[(Int, Int)]
  while(continue){
    val Array(x, y) = StdIn.readLine().trim.split(' ').map(_.toInt)
    continue = if(x == 0 && y == 0) {
      false
    } else {
      result += ((y, x))
      true
    }
  }
  
  print(result.map(p => p._1 + " " + p._2 ).mkString(f"%n"))
}

