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.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * 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);
        CShawarmaTent solver = new CShawarmaTent();
        solver.solve(1, in, out);
        out.close();
    }

    static class CShawarmaTent {
        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int n = sc.nextInt();
            int max = Integer.MIN_VALUE, max2 = Integer.MIN_VALUE;
            int min = Integer.MAX_VALUE, min2 = Integer.MIN_VALUE;
            int x = sc.nextInt(), y = sc.nextInt();
            int countX1 = 0, countX2 = 0, countY1 = 0, countY2 = 0;
            for (int i = 0; i < n; i++) {
                int xx = sc.nextInt(), yy = sc.nextInt();
                if (xx <= x) {
                    max = Math.max(max, xx);
                    countX1++;
                } else {
                    min = Math.min(min, xx);
                    countX2++;
                }
                if (yy <= y) {
                    max2 = Math.max(max2, yy);
                    countY1++;
                } else {
                    min2 = Math.min(min2, yy);
                    countY2++;
                }
            }
            int ansX = countX1 >= countX2 ? max : min;
            int ansY = countY1 > countY2 ? max2 : min2;
            pw.println(Math.min(Math.max(countY1, countY2), Math.max(countX1, countX2)));
            pw.println(ansX + " " + ansY);
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

