process.stdin.setEncoding('utf-8');
process.stdin.on('data', (input) => {
  console.log(input);
  var [x, y] = input.split(' ');
  var a = parseInt(x);
  var b = parseInt(y);
  if (a === 0 && b === 0) {
    process.exit(); 
  } else if (a < b){
    console.log(a, b);
  } else {
    console.log(b, a);
  }
})
