process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function (chunk) {
    var input = chunk.split("\n");
    var output = "";
    var nums = new Array();
    
    for (var i = 0; i < input.length; i ++){
        nums[i] = input[i].split(" ");
    }
    
    for(var i = 0; i < nums.length; i ++){
        if (!order(nums[i])){
            break;
        }
        console.log(nums[i][0] + " " + nums[i][1]);
    }
    
    function order(obj){
        if (obj[0] == 0 && obj[1] == 0){
            return false;
        }
        if(obj[0] > obj[1]){
            var temp = obj[1];
            obj[1] = obj[0];
            obj[0] = temp;
        }
        return true;
    }
});