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 Exception{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer stt;
        stt=new StringTokenizer(br.readLine());
        int t=Integer.parseInt(stt.nextToken()), school_x=Integer.parseInt(stt.nextToken()), school_y=Integer.parseInt(stt.nextToken());
        int school_1stQuad=0;
        int school_2ndQuad=0;
        int school_3rdQuad=0;
        int school_4thQuad=0;
        int x1=Integer.MAX_VALUE;
        int x2=Integer.MIN_VALUE;
        int x4=Integer.MIN_VALUE;
        int x3=Integer.MAX_VALUE;
        for(int i=0; i<t; i++){
            stt=new StringTokenizer(br.readLine());
            int x=Integer.parseInt(stt.nextToken()), y=Integer.parseInt(stt.nextToken());
            if(x>=school_x){ school_1stQuad+=1; if(x<=x1) x1=x;}
            else{ school_2ndQuad+=1; if(x>=x2) x2=x;}
            if(y<=school_y){ school_4thQuad+=1; if(y>=x4) x4=y;}
            else{ school_3rdQuad+=1; if(y<=x3) x3=y;}
        }
        if(school_1stQuad>school_4thQuad && school_1stQuad>school_2ndQuad && school_1stQuad>school_3rdQuad){
            System.out.println(school_1stQuad); 
            if(school_3rdQuad>school_4thQuad) System.out.println(x1+" "+x3);
            else System.out.println(x1+" "+x4);
        }
        else if(school_2ndQuad>school_4thQuad && school_2ndQuad>school_3rdQuad && school_2ndQuad>school_1stQuad){
            System.out.println(school_2ndQuad);
            if(school_3rdQuad>school_4thQuad) System.out.println(x2+" "+x3);
            else System.out.println(x2+" "+x4);
        }
        else if(school_3rdQuad>school_4thQuad && school_3rdQuad>school_2ndQuad && school_3rdQuad>school_1stQuad){
            System.out.println(school_3rdQuad); 
            if(school_1stQuad>school_2ndQuad) System.out.println(x1+" "+x3);
            else System.out.println(x2+" "+x3);
        }
        else{
            System.out.println(school_4thQuad); 
            if(school_1stQuad>school_2ndQuad) System.out.println(x1+" "+x4);
            else System.out.println(x2+" "+x4);
        }
        return;
    }
}