var body = '';
var readable = process.stdin;
readable.resume();
readable.setEncoding( 'utf-8' );
readable.on( 'data', function( chunk ) {
  body += chunk;
});
readable.on( 'end', function() {
  var data = body.split( '\n' );
  for( var i=0; i<data.length; i++ ) {
    var nums = data[0].split( ' ' );
    var a = parseInt( nums[0] );
    var b = parseInt( nums[1] );
  
    if( b < a ) {
      var t = a;
      a = b;
      b = t;
    }
    if( 0 != a || 0 !=  b ) {  
      console.log( '%d %d', a, b );
    }
  }
});