"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let xs1 = xs[0].trim().split(' ');
   let xs2 = xs[1].trim().split(' ').map(v=>parseInt(v,10));
   let xs3 = xs[2].trim().split(' ');
   let ans = 0;
   
   if(xs1[0]==xs3[0]){
     ans = xs2[0] - 1;
     console.log(ans+' '+xs2[1]);
   }else if(xs1[1]==xs3[0]){
     ans = xs2[1] - 1;
     console.log(xs2[0]+' '+ans);
   }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));