'use strict'

const main = arg => {
 const input = arg.trim().split("\n");
 const result = input.filter(num => num !== "0 0").map(num => { 
     const separate = num.split(" ").sort((a, b) => a - b);
     return `${separate[0]} ${separate[1]}`;
 });

 console.log(result.join("\n"));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


