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.*;
public class Main {
    public static void main(String args[])
    {
        FastReader input=new FastReader();
        PrintWriter out=new PrintWriter(System.out);
        int T=1;
        while(T-->0)
        {
            int n=input.nextInt();
            int sx=input.nextInt();
            int sy=input.nextInt();
            int arr[][]=new int[n][2];
            for(int i=0;i<n;i++)
            {
                int x=input.nextInt();
                int y=input.nextInt();
                arr[i][0]=x;
                arr[i][1]=y;
            }
            int tx=0,ty=0;
            int max=0;
            int count=0;
            for(int i=0;i<n;i++)
            {
                int x=arr[i][0];
                int y=arr[i][1];
                if(x<=sx-1)
                {
                    count++;
                }
            }
            if(count>=max)
            {
                tx=sx-1;
                ty=sy;
            }
            max=Math.max(max,count);
            count=0;
            for(int i=0;i<n;i++)
            {
                int x=arr[i][0];
                int y=arr[i][1];
                if(x>=sx+1)
                {
                    count++;
                }
            }
            if(count>=max)
            {
                tx=sx+1;
                ty=sy;
            }
            max=Math.max(max,count);
            count=0;
            for(int i=0;i<n;i++)
            {
                int x=arr[i][0];
                int y=arr[i][1];
                if(y>=sy+1)
                {
                    count++;
                }
            }
            if(count>=max)
            {
                tx=sx;
                ty=sy+1;
            }
            max=Math.max(max,count);
            count=0;
            for(int i=0;i<n;i++)
            {
                int x=arr[i][0];
                int y=arr[i][1];
                if(y<=sy-1)
                {
                    count++;
                }
            }
            if(count>=max)
            {
                tx=sx;
                ty=sy-1;
            }
            max=Math.max(max,count);
            out.println(max);
            out.println(tx+" "+ty);
        }
        out.close();
    }
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
        public FastReader()
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt()
        {
            return Integer.parseInt(next());
        }
        long nextLong()
        {
            return Long.parseLong(next());
        }
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
        String nextLine()
        {
            String str="";
            try
            {
                str=br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}