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.util.*;
import java.io.*;
public class Main
{
    public static void main(String []args) throws IOException {
    	FastScanner in  = new FastScanner(System.in);
    	PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false); 
    	solve(in, out);
    	in.close();
    	out.close();
    }
    static long gcd(long a, long b){ return (b==0) ? a : gcd(b, a%b); }
    static int gcd(int a, int b){ return (b==0) ? a : gcd(b, a%b); }
    
    static class FastScanner{
	BufferedReader reader;
	StringTokenizer st;
	FastScanner(InputStream stream){reader=new BufferedReader(new InputStreamReader(stream));st=null;}	
	String next(){while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}		    
	     st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
	String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}	    	  	
	int    nextInt()   {return Integer.parseInt(next());}
	long   nextLong()  {return Long.parseLong(next());}		
	double nextDouble(){return Double.parseDouble(next());}
	char   nextChar()  {return next().charAt(0);}
	int[]  nextIntArray(int n)         {int[] arr= new int[n];   int i=0;while(i<n){arr[i++]=nextInt();}  return arr;}
	long[] nextLongArray(int n)        {long[]arr= new long[n];  int i=0;while(i<n){arr[i++]=nextLong();} return arr;}	
	int[]  nextIntArrayOneBased(int n) {int[] arr= new int[n+1]; int i=1;while(i<=n){arr[i++]=nextInt();} return arr;}	    	
	long[] nextLongArrayOneBased(int n){long[]arr= new long[n+1];int i=1;while(i<=n){arr[i++]=nextLong();}return arr;}	    	
	void   close(){try{reader.close();}catch(IOException e){e.printStackTrace();}}				
    }
    
    /********* SOLUTION STARTS HERE ************/
    
    private static void solve(FastScanner in, PrintWriter out){
        int big = (int)1e9;
        int n = in.nextInt();
        int x = in.nextInt();
        int y = in.nextInt();
        int left=0,right=0,up=0,down=0,u=0,v=0;
        for(int i=0;i<n;i++){
            u = in.nextInt();
            v = in.nextInt();
            if(u<x) left++;
            if(u>x) right++;
            if(v<y) down++;
            if(v>y) up++;
        }
        
        int mx = Math.max(Math.max(up,down),Math.max(left,right));
        int ansx = -1;
        int ansy = -1;
        if(left == mx){
            if(x!=0){
                ansx = x-1;
                ansy = y;
            }
        }
        if(right==mx) {
            if(x!=big){
                ansx = x+1;
                ansy = y;
            }
        }
        if(up==mx) {
            if(y!=big){
                ansx = x;
                ansy = y+1;
            }
        }
        if(down==mx)
        {
            if(y!=0){
                ansx = x;
                ansy = y-1;
            }
        }
        out.write(mx+"\n"+ansx+" "+ansy+"\n");
    }
    
    /************* SOLUTION ENDS HERE **********/
}