const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const lines = input.trim().split('\n');

while (line = lines.shift()) {
    const numbers = line.split(' ').map(Number);

    // Edit from here
    try {

    if(first === 0 && second === 0) throw err;
if(first < 0 || second > 10000) throw err;

if(first>second){
	console.log(second + " " + first);
} else {
	console.log(first + " " + second);
} 
}catch (err) {
        
}

    // to here
    

    
}
