var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', function (line) {
  var a = line.split(' ');
  var c = parseInt(a[0],10);
  var d = parseInt(a[1],10);
  if(c==d && c==0)
    process.exit();
  if(c>d)
    console.log(d+" "+c);
  else
    console.log(c+" "+d);
});
process.stdin.on('end', function () {
});