var input = '';
var readable = process.stdin;
readable.resume();
readable.setEncoding( 'utf-8' );
readable.on( 'data', function( chunk ) {
  input += chunk;
});

readable.on( 'end', function() {
  var data = input.split( '\n' );
  var output = [];
  for( var i=0; i<data.length; i++ ) {
    var xy = data[i].split( ' ' );
    if( "0 0" == data[i] ) { break; }
    
    if( parseInt( xy[1] ) < parseInt( xy[0] ) ) {  
      output.push( xy[1]+' '+xy[0] );
    } else {
      output.push( data[i] );      
    }
  }
  console.log( output.join( '\n' )  );
});