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

let first = lines[0];
let second = lines[1];

if(first === 0 || second === 0 || first < 0 || second > 10000){
	break;
}

if(a>b){
	console.log(final = b + " " + a);
} else {
	console.log(final = a + " " + b);
}
