process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {
 
var line = chunk.split(' ');
var x = Number(line[0]);
var y = Number(line[1]);


var min = Math.min(x,y);

if(x == 0 && y== 0){break;}

console.log(min);
    
});