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.Comparator;
import java.math.*;
import java.util.Arrays;
import java.awt.*;
import java.io.*;
import java.util.Iterator;
import java.util.*;


public class CP {
    public static void main(String[] args) throws Exception {
        /*new Thread(null, new Runnable() {
            @Override
            public void run() {
                try {
                    new Solver().solve();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, "Solver", 1l << 30).start();*/

        new Solver().solve();
    }
}

class Solver {
    final Helper hp;
    final int MAXN = 1000_006;
    final long MOD = (long) 1e9 + 7;

    Solver() {
        hp = new Helper(MOD, MAXN);
        hp.initIO(System.in, System.out);
    }

    int N;
    long X, Y;
    long[][] pts;

    void solve() throws Exception {
        int i, j, k;

        N = hp.nextInt();
        X = hp.nextLong(); Y = hp.nextLong();
        pts = new long[N][];
        for (i = 0; i < N; ++i) pts[i] = new long[] {hp.nextLong(), hp.nextLong()};
        Arrays.sort(pts, (a, b) -> Long.compare(a[0], b[0]));

        long[] A = new long[N];
        for (i = 0; i < N; ++i) A[i] = pts[i][1];
        MergeSortTree mst = new MergeSortTree(A);

        long[] pt = null;
        long ans = 0;
        for (i = -1; i <= 1; ++i) for (j = -1; j <= 1; ++j) if (i != 0 || j != 0) {
            long x = X + i, y = Y + j;
            //System.out.println(x + " " + y);

            if (i <= 0 && j <= 0) {
                int pos = bsFloor(x);
                long c = mst.rangeQuery(0, pos, y);

                if (c > ans) {
                    ans = c;
                    pt = new long[] {x, y};
                }
            }
            if (i <= 0 && j >= 0) {
                int pos = bsFloor(x);
                long c = (pos + 1) - mst.rangeQuery(0, pos, y - 1);

                if (c > ans) {
                    ans = c;
                    pt = new long[] {x, y};
                }
            }
            if (i >= 0 && j <= 0) {
                int pos = bsCeil(x);
                long c = mst.rangeQuery(pos, N, y);

                if (c > ans) {
                    ans = c;
                    pt = new long[] {x, y};
                }
            }
            if (i >= 0 && j >= 0) {
                int pos = bsCeil(x);
                long c = (N - pos) - mst.rangeQuery(pos, N, y - 1);

                if (c > ans) {
                    ans = c;
                    pt = new long[] {x, y};
                }
            }
        }

        hp.println(ans);
        hp.println(hp.joinElements(pt));

        hp.flush();
    }

    int bsFloor(long val) {
        int l = 0, r = N - 1;
        while (true) {
            int mid = l + r >> 1;
            if (l + 1 >= r) {
                if (pts[r][0] <= val) return r;
                else if (pts[l][0] > val) return l - 1;
                else return l;
            } else if (pts[mid][0] <= val) l = mid;
            else r = mid - 1;
        }
    }

    int bsCeil(long val) {
        int pos = bsFloor(val - 1);
        while (pos + 1 < N && pts[pos + 1][0] < val) ++pos;
        return pos;
    }
}

class myArrayListLong implements Iterable<Long> {
    private int len;
    private long[] A;

    public myArrayListLong(int initialLength) {
        A = new long[Math.max(1, initialLength)];
        len = 0;
    }

    public myArrayListLong(myArrayListLong src) {
        A = new long[src.A.length];
        System.arraycopy(src.A, 0, A, 0, src.len);
        len = src.len;
    }

    public void add(long ele) {
        if (len == A.length) {
            long[] newAr = new long[A.length << 1];
            System.arraycopy(A, 0, newAr, 0, len);
            A = newAr;
        }
        A[len++] = ele;
    }

    public void set(int ind, long ele) throws Exception {
        if (ind >= len) throw new ArrayIndexOutOfBoundsException(ind);
        else if (ind < 0) ind += size();
        A[ind] = ele;
    }

    public long get(int ind) {
        if (ind >= len) throw new ArrayIndexOutOfBoundsException(ind);
        else if (ind < 0) ind += size();
        return A[ind];
    }

    public long pop() {
        return A[--len];
    }

    public void clear() {
        len = 0;
    }

    public int size() {
        return len;
    }

    public int length() {
        return len;
    }

    public boolean isEmpty() {
        return len == 0;
    }

    public myArrayListLong mergeSorted(myArrayListLong list) {
        myArrayListLong ret = new myArrayListLong(size() + list.size());
        int p1 = 0, p2 = 0;
        while (p1 < size() || p2 < list.size()) {
            if (p1 >= size()) ret.add(list.get(p2++));
            else if (p2 >= list.size()) ret.add(get(p1++));
            else if (get(p1) <= list.get(p2)) ret.add(get(p1++));
            else ret.add(list.get(p2++));
        }
        return ret;
    }

    public void sort(int fromIndex, int toIndex) {
        Arrays.sort(A, fromIndex, toIndex);
    }

    public void sort() {
        sort(0, size());
    }

    public void sort(int fromIndex, int toIndex, Comparator<Long> com) {
        Long[] temp = new Long[toIndex - fromIndex];
        for (int i = fromIndex, k = 0; i < toIndex; ++i) temp[k++] = A[i];
        Arrays.sort(temp, com);
        for (int i = fromIndex, k = 0; i < toIndex; ++i) A[i] = temp[k++];
    }

    public void reverse() {
        for (int i = 0; i < size() >> 1; ++i) {
            int j = size() - 1 - i;
            A[i] ^= A[j];
            A[j] ^= A[i];
            A[i] ^= A[j];
        }
    }

    public int countFloor(long key) {
        // counts number of elements <= key provided this list is sorted
        if (isEmpty()) return 0;
        int l = 0, r = size() - 1, mid;
        while (true) {
            mid = l + r >> 1;
            if (l + 1 >= r) {
                if (get(r) <= key) return r + 1;
                else if (get(l) > key) return l;
                else return r;
            } else if (get(mid) <= key) l = mid + 1;
            else r = mid;
        }
    }

    int itrInd;

    public Iterator<Long> iterator() {
        itrInd = 0;
        Iterator<Long> iterator = new Iterator<Long>() {
            @Override
            public boolean hasNext() {
                return itrInd < size();
            }

            @Override
            public Long next() {
                return get(itrInd++);
            }
        };
        return iterator;
    }

    public myArrayListLong clone() {
        return new myArrayListLong(this);
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < len; i++) sb.append(A[i]).append(" ");
        return sb.toString().trim();
    }
}
class MergeSortTree {
    private int N;
    private myArrayListLong[] tree;

    public MergeSortTree(long[] ar) {
        N = 1;
        while (N < ar.length) N <<= 1;
        tree = new myArrayListLong[N * 2 - 1];

        for (int i = N - 1; i < tree.length; ++i) tree[i] = new myArrayListLong(-7);
        for (int i = 0; i < ar.length; ++i) tree[i + N - 1].add(ar[i]);
        for (int i = N - 2; i >= 0; --i) tree[i] = tree[i * 2 + 1].mergeSorted(tree[i * 2 + 2]);
    }

    public long rangeQuery(int l, int r, long key) {
        return query(0, 0, N - 1, l, r, key);
    }

    private long query(int i, int l, int r, int ql, int qr, long key) {
        int mid = l + r >> 1, i2 = i << 1;
        if (l > qr || r < ql) return 0;
        else if (l >= ql && r <= qr) return tree[i].countFloor(key);
        else return query(i2 + 1, l, mid, ql, qr, key) + query(i2 + 2, mid + 1, r, ql, qr, key);
    }
}

class Helper {
    final long MOD;
    final int MAXN;
    final Random rnd;

    public Helper(long mod, int maxn) {
        MOD = mod;
        MAXN = maxn;
        rnd = new Random();
    }


    public static int[] sieve;
    public static ArrayList<Integer> primes;

    public void setSieve() {
        primes = new ArrayList<>();
        sieve = new int[MAXN];
        int i, j;
        for (i = 2; i < MAXN; ++i)
            if (sieve[i] == 0) {
                primes.add(i);
                for (j = i; j < MAXN; j += i) {
                    sieve[j] = i;
                }
            }
    }


    public static long[] factorial;

    public void setFactorial() {
        factorial = new long[MAXN];
        factorial[0] = 1;
        for (int i = 1; i < MAXN; ++i) factorial[i] = factorial[i - 1] * i % MOD;
    }

    public long getFactorial(int n) {
        if (factorial == null) setFactorial();
        return factorial[n];
    }

    public long ncr(int n, int r) {
        if (r > n) return 0;
        if (factorial == null) setFactorial();
        long numerator = factorial[n];
        long denominator = factorial[r] * factorial[n - r] % MOD;
        return numerator * pow(denominator, MOD - 2, MOD) % MOD;
    }


    public long[] getLongArray(int size) throws Exception {
        long[] ar = new long[size];
        for (int i = 0; i < size; ++i) ar[i] = nextLong();
        return ar;
    }

    public int[] getIntArray(int size) throws Exception {
        int[] ar = new int[size];
        for (int i = 0; i < size; ++i) ar[i] = nextInt();
        return ar;
    }

    public String[] getStringArray(int size) throws Exception {
        String[] ar = new String[size];
        for (int i = 0; i < size; ++i) ar[i] = next();
        return ar;
    }

    public String joinElements(long[] ar) {
        StringBuilder sb = new StringBuilder();
        for (long itr : ar) sb.append(itr).append(" ");
        return sb.toString().trim();
    }


    public String joinElements(int[] ar) {
        StringBuilder sb = new StringBuilder();
        for (int itr : ar) sb.append(itr).append(" ");
        return sb.toString().trim();
    }

    public String joinElements(String[] ar) {
        StringBuilder sb = new StringBuilder();
        for (String itr : ar) sb.append(itr).append(" ");
        return sb.toString().trim();
    }

    public String joinElements(Object[] ar) {
        StringBuilder sb = new StringBuilder();
        for (Object itr : ar) sb.append(itr).append(" ");
        return sb.toString().trim();
    }


    public long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    public int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }


    public long max(long[] ar) {
        long ret = ar[0];
        for (long itr : ar) ret = Math.max(ret, itr);
        return ret;
    }

    public int max(int[] ar) {
        int ret = ar[0];
        for (int itr : ar) ret = Math.max(ret, itr);
        return ret;
    }

    public long min(long[] ar) {
        long ret = ar[0];
        for (long itr : ar) ret = Math.min(ret, itr);
        return ret;
    }

    public int min(int[] ar) {
        int ret = ar[0];
        for (int itr : ar) ret = Math.min(ret, itr);
        return ret;
    }


    public long sum(long[] ar) {
        long sum = 0;
        for (long itr : ar) sum += itr;
        return sum;
    }

    public long sum(int[] ar) {
        long sum = 0;
        for (int itr : ar) sum += itr;
        return sum;
    }

    public void shuffle(int[] ar) {
        int r;
        for (int i = 0; i < ar.length; ++i) {
            r = rnd.nextInt(ar.length);
            if (r != i) {
                ar[i] ^= ar[r];
                ar[r] ^= ar[i];
                ar[i] ^= ar[r];
            }
        }
    }

    public void shuffle(long[] ar) {
        int r;
        for (int i = 0; i < ar.length; ++i) {
            r = rnd.nextInt(ar.length);
            if (r != i) {
                ar[i] ^= ar[r];
                ar[r] ^= ar[i];
                ar[i] ^= ar[r];
            }
        }
    }

    public long pow(long base, long exp, long MOD) {
        base %= MOD;
        long ret = 1;
        while (exp > 0) {
            if ((exp & 1) == 1) ret = ret * base % MOD;
            base = base * base % MOD;
            exp >>= 1;
        }
        return ret;
    }


    static byte[] buf = new byte[2048];
    static int index, total;
    static InputStream in;
    static BufferedWriter bw;


    public void initIO(InputStream is, OutputStream os) {
        try {
            in = is;
            bw = new BufferedWriter(new OutputStreamWriter(os));
        } catch (Exception e) {
        }
    }

    public void initIO(String inputFile, String outputFile) {
        try {
            in = new FileInputStream(inputFile);
            bw = new BufferedWriter(new OutputStreamWriter(
                    new FileOutputStream(outputFile)));
        } catch (Exception e) {
        }
    }

    private int scan() throws Exception {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0)
                return -1;
        }
        return buf[index++];
    }

    public String next() throws Exception {
        int c;
        for (c = scan(); c <= 32; c = scan()) ;
        StringBuilder sb = new StringBuilder();
        for (; c > 32; c = scan())
            sb.append((char) c);
        return sb.toString();
    }

    public int nextInt() throws Exception {
        int c, val = 0;
        for (c = scan(); c <= 32; c = scan()) ;
        boolean neg = c == '-';
        if (c == '-' || c == '+')
            c = scan();
        for (; c >= '0' && c <= '9'; c = scan())
            val = (val << 3) + (val << 1) + (c & 15);
        return neg ? -val : val;
    }

    public long nextLong() throws Exception {
        int c;
        long val = 0;
        for (c = scan(); c <= 32; c = scan()) ;
        boolean neg = c == '-';
        if (c == '-' || c == '+')
            c = scan();
        for (; c >= '0' && c <= '9'; c = scan())
            val = (val << 3) + (val << 1) + (c & 15);
        return neg ? -val : val;
    }

    public void print(Object a) throws Exception {
        bw.write(a.toString());
    }

    public void printsp(Object a) throws Exception {
        print(a);
        print(" ");
    }

    public void println() throws Exception {
        bw.write("\n");
    }

    public void println(Object a) throws Exception {
        print(a);
        println();
    }

    public void flush() throws Exception {
        bw.flush();
    }
}
