'use strict';
function main(input) {
  input = input.split("\n");
  const a = input[0].split(" ");
  const b = parseInt(input[0], 10).split(" ");
  const c = input;

  if (a[0] === c) {
    b[0] --;
  } else {
    b[1] --;
  }
  
  console.log(b[0], b[1]);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));