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

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

try {
if(first === 0 && second === 0) return;
if(first < 0 || second > 10000) throw err;
if(first>second){
	console.log(final = second + " " + first);
} else {
	console.log(final = first + " " + second);
} catch (err) {
        console.log("End or invalid");
}


