function Main(input){
	input=input.trim().split("\n");
	let x, y, tmp;
	for (let i = 0; i < (input.length - 1); i++){
		tmp = input[i].split(" ");
		x = parseInt(tmp[0], 10);
		y = parseInt(tmp[1], 10);
		if (x > y){
			[x, y] = [y, x];
		}
		console.log("%d %d", x, y);
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

