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 SwarmaTents
{
    static void solve()
    {
        int n =sc.nextInt();

//        corrdinates of school
        point s = new point ();
        s.x=sc.nextLong();
        s.y= sc.nextLong();

//        coordinates of left
        point l = new point ();
        l.x = s.x-1;
        l.y = s.y;
        int cl=0;

//          coordinates of right
        point r = new point ();
        r.x = s.x+1;
        r.y = s.y;
        int cr=0;

//        coordinates of up
        point up = new point ();
        up.x = s.x;
        up.y = s.y+1;
        int cu=0;

//        coordinates of down
        point d = new point ();
        d.x = s.x;
        d.y = s.y-1;
        int cd=0;

//        System.out.println("left "+l.x+" "+l.y);
//        System.out.println("right "+r.x+" "+r.y);
//        System.out.println("up "+up.x+" "+up.y);
//        System.out.println("down "+d.x+" "+d.y);
        point max =new point();
       int maxno =Integer.MIN_VALUE;
        point houses[] = new point[n];
        for(int i = 0;i < n;i++)
        {
            houses[i] = new point();
            houses[i].x = sc.nextLong();
            houses[i].y = sc.nextLong();
//            System.out.println(houses[i].x+" "+houses[i].y);


            if(houses[i].x<=l.x)
                cl++;
            if(houses[i].x>=r.x)
                cr++;
            if(houses[i].y>=up.y)
                cu++;
            if(houses[i].y<=d.y)
                cd++;

            if(maxno<cl)
            {
                maxno = cl;
                max.x = l.x;
                max.y=l.y;
            }
            else if(maxno<cr)
            {
                maxno = cr;
                max.x = r.x;
                max.y=r.y;
            }
            else if(maxno<cu)
            {
                maxno = cu;
                max.x = up.x;
                max.y=up.y;
            } else if(maxno<cd)
            {
                maxno = cd;
                max.x = d.x;
                max.y=d.y;
            }
        }

        System.out.println(maxno);
        System.out.println(max.x+" "+max.y);








    }
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args)
    {
        solve();
    }

}
class point
{
    long x;
    long y;
}
