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
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		    int n = sc.nextInt();
		    int sx = sc.nextInt();
		    int sy = sc.nextInt();
		    int first = 0;
		    int second = 0;
		    int third = 0;
		    int fourth = 0;
		    int ax1 = 0, ax2 = 0, ax3 = 0, ax4 = 0;
		    for(int i = 0; i<n; i++){
		        int x = sc.nextInt();
		        int y = sc.nextInt();
		        if(x > sx && y > sy)first++;
		        if(x > sx && y < sy)fourth++;
		        if(x < sx && y < sy)third++;
		        if(x < sx && y > sy)second++;
		        if(x == sx && y < sy)ax3++;
		        else if(x == sx)ax1++;
		        if(y == sy && x < sx)ax4++;
		        else if(y == sy)ax2++;
		    }
		    ax1 += first + second;
		    ax2 += first + fourth;
		    ax3 += third + fourth;
		    ax4 += second + third;
		    out.println(ax1 + " " + ax2 + " " + ax3 + " " + ax4);
		    if(Math.max(ax1, Math.max(ax2, Math.max(ax3, ax4))) == ax1){
		        out.println(ax1);
		        out.println(sx + " " + (sy + 1));
		    }
		    else if(Math.max(ax1, Math.max(ax2, Math.max(ax3, ax4))) == ax2){
		        out.println(ax2);
		        out.println((sx + 1) + " " + sy);
		    }
		    else if(Math.max(ax1, Math.max(ax2, Math.max(ax3, ax4))) == ax3){
		        out.println(ax3);
		        out.println(sx + " " + (sy - 1));
		    }
		    else{
		        if(Math.max(ax1, Math.max(ax2, Math.max(ax3, ax4))) == ax4){
		        out.println(ax4);
		        out.println((sx - 1) + " " + sy);
		        }
		    }
		out.flush();
	}
}
