process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var i = 0;
 var tmp = 0;
 while(true){
   var num = lines[i].split(' ');
   if(num[0] == 0 && num[1] == 0){
     break;
   }
   var newnum = num.map(function(str) { return Number(str)});

   if(newnum[0] > newnum[1]){
     tmp = newnum[0];
     newnum[0] = newnum[1];
     newnum[1] = tmp;
   }
   console.log(newnum.join(' '));
   
   i++;
 }
});
