var std = process.stdin;
std.resume();
std.setEncoding('utf8');
std.on('data', function (chunk) {
    var datas = chunk.split(/\n/);
    
    for (var i = 0; i < datas.length; i++) {
        var data = datas[i].split(' ').map(Number);
        
        if (data[0] === 0 && data[1] === 0) { break; }
        
        console.log(Math.min(data[0], data[1]) + " " + Math.max(data[0], data[1]));
    }
});