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.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			int n = sc.nextInt();
			int x = sc.nextInt();
			int y = sc.nextInt();
			int sx[] = new int[n];
			int sy[] = new int[n];
			for (int i = 0; i < n; i++) {
				sx[i] = sc.nextInt();
				sy[i] = sc.nextInt();
			}
		
			
			int ans[]=new int [4];
			int ax[]=new int [4];
			int ay[]=new int [4];
			ax[1]=Integer.MAX_VALUE;
			ax[2]=Integer.MAX_VALUE;
			ay[2]=Integer.MAX_VALUE;
			ay[3]=Integer.MAX_VALUE;
			for (int i = 0; i < n; i++) {
				if (sx[i] <= x ) {
					ans[0]++;
					ax[0] = Math.max(ax[0], sx[i]);
					ay[0]= y;
					int z=0;
					if(ax[0]==x) {
						 for (int j = 0; j < n; j++) {
							 if(ax[j]==x) {
								z++; 
							 }
						}
						 ans[0]-=z;
						 ax[0]-=1;
					}
				}  if (sx[i] >= x ) {
					ans[1]++;
					ax[1] = Math.min(ax[1], sx[i]);
					ay[1]= y;
					int z=0;
					if(ax[1]==x) {
						 for (int j = 0; j < n; j++) {
							 if(ax[j]==x) {
								z++; 
							 }
						}
						 ans[1]-=z;
						 ax[1]+=1;
					}
				} if ( sy[i] >= y) {
					ans[2]++;
					ax[2] = x;
					ay[2] = Math.min(ay[2], sy[i]);
					int z=0;
					if(ay[2]==y) {
						 for (int j = 0; j < n; j++) {
							 if(ay[j]==y) {
								z++; 
							 }
						}
						 ans[2]-=z;
						 ay[2]+=1;
					}
				} if ( sy[i] <= y) {
					ans[3]++;
					ax[3] = x;
					ay[3] = Math.min(ay[3], sy[i]);
					int z=0;
					if(ay[3]==y) {
						 for (int j = 0; j < n; j++) {
							 if(ay[j]==y) {
								z++; 
							 }
						}
						 ans[3]-=z;
						 ay[3]-=1;
					}
				}

			}
			//System.out.println(ax[3]+" "+ay[3]);
			int max=0;
			int zx=0,zy=0;
			for (int i = 0; i < 4; i++) {
				if(ax[i]==x&&ay[i]==y) {
					continue;
				}
				if(max<ans[i]) {
					max=ans[i];
					zx=ax[i];
					zy=ay[i];
				}
				}
			
			System.out.println(max);
			System.out.println(zx+" "+zy);

		}
	}

}
