1 1000000000 7
1000000000 9
 3 2 2
2 4
2 1
3 6
 2 1000000000 100000
1000000000 1000000
1000000000 10000
 1 100 100
50 70
 1 100 100
101 100

1
1000000000 8 2
2 3 1
1000000000 100001 1
99 100 1
101 100
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    public class tent
    {
        public static void main(String args[])throws IOException
        {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String are[]=(br.readLine()).split(" ");
            int n=Integer.parseInt(are[0]);
            int x1=Integer.parseInt(are[1]);
            int y=Integer.parseInt(are[2]);
            int a=0,b=0,c=0,d=0;
            for(int i=0;i<n;i++)
            {
                String x[]=(br.readLine()).split(" ");
                int t_x=Integer.parseInt(x[0]);
                int t_y=Integer.parseInt(x[1]);
                if(t_x>x1)
                {
                    a++;
                }
                else
                {
                    b++;
                }
                if(t_y>y)
                {
                    c++;
                }
                else
                {
                    d++;
                }
            }
            int an=Math.max(a,b);
            an=Math.max(an,c);
            an=Math.max(an,d);
            if(an==a)
            {
               System.out.println(x1+1+" "+y);
            }
            else if(an==b)
            {
               System.out.println(x1-1+" "+y); 
            }
            else if(an==c)
            {
                System.out.println(y+1+" "+x1);
            }
            else
            {
                System.out.println(x1 +" "+(y-1));
            }
            }
        }
    