function Main(input) {
	input = input.split("\n");
	input[0] = input[0].split(" ");
	input[1] = input[1].split(" ");
	var ans = input[1];
	if(input[2]==input[0][0]) ans[0]--;
	else ans[1]--;
	console.log(ans.join(" ")); 
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());