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.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int n = in.nextInt();
            int sX = in.nextInt();
            int sY = in.nextInt();
            int nums[][] = new int[n][2];
            for (int i = 0; i < n; i++)
            {
                nums[i][0] = in.nextInt();
                nums[i][1] = in.nextInt();
            }
            // sX, sY+1
            int countQ1 = countQ1(nums, sX, sY + 1);
            int countQ2 = countQ2(nums, sX + 1, sY + 1);

            // sX, sY+1
            int countQ3 = countQ2(nums, sX + 1, sY + 1);
            int countQ4 = countQ4(nums, sX + 1, sY);

            // sX-1, sY
            int countQ5 = countQ1(nums, sX - 1, sY + 1);
            int countQ6 = countQ3(nums, sX - 1, sY);

            // sX, sY-1
            int countQ7 = countQ3(nums, sX - 1, sY - 1);
            int countQ8 = countQ4(nums, sX, sY - 1);

            int tentX = 0;
            int tentY = 0;

            int tentMax = countQ1 + countQ2;
            tentX = sX;
            tentY = sY + 1;

            if (tentMax < countQ3 + countQ4)
            {
                tentMax = countQ3 + countQ4;
                tentX = sX + 1;
                tentY = sY;
            }

            if (tentMax < countQ5 + countQ6)
            {
                tentMax = countQ5 + countQ6;
                tentX = sX - 1;
                tentY = sY;
            }

            if (tentMax < countQ7 + countQ8)
            {
                tentMax = countQ7 + countQ8;
                tentX = sX;
                tentY = sY - 1;
            }

            out.println(tentMax);
            out.print(tentX + " " + tentY);
        }

        private int countQ1(int[][] nums, int sX, int sY)
        {
            int cnt = 0;
            for (int i = 0; i < nums.length; i++)
            {
                if (nums[i][0] <= sX && nums[i][1] >= sY)
                    cnt++;
            }
            return cnt;
        }

        private int countQ2(int[][] nums, int sX, int sY)
        {
            int cnt = 0;
            for (int i = 0; i < nums.length; i++)
            {
                if (nums[i][0] >= sX && nums[i][1] >= sY)
                    cnt++;
            }
            return cnt;
        }

        private int countQ3(int[][] nums, int sX, int sY)
        {
            int cnt = 0;
            for (int i = 0; i < nums.length; i++)
            {
                if (nums[i][0] <= sX && nums[i][1] <= sY)
                    cnt++;
            }
            return cnt;
        }

        private int countQ4(int[][] nums, int sX, int sY)
        {
            int cnt = 0;
            for (int i = 0; i < nums.length; i++)
            {
                if (nums[i][0] >= sX && nums[i][1] <= sY)
                    cnt++;
            }
            return cnt;
        }

    }
}

