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.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Stack;

import javax.swing.event.ListSelectionEvent;

public class ROUGH{
	public static class FastReader {
		BufferedReader br;
		StringTokenizer root;
		
 
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
 
		String next() {
			while (root == null || !root.hasMoreTokens()) {
				try {
					root = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return root.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		double nextDouble() {
			return Double.parseDouble(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static int mod = (int) (1e9+7);
	static long cf = 998244353;
    static final long MAX = (long) 1e15;
    
    public static List<Integer>[] edges;
    public static int[][] parent;
    public static int col = 32;
    public static int[] Bit;

	public static void main(String[] args) {
		FastReader sc = new FastReader();
		
		int n = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		TreeMap<Integer,Integer> mapx = new TreeMap<>();
		TreeMap<Integer,Integer> mapy = new TreeMap<>();
		for(int i=0;i<n;++i) {
			int xi = sc.nextInt();
			int yi = sc.nextInt();
			add(mapx,xi);
			add(mapy,yi);
		}
		
		int xl = 0,xr = 0,yu = 0,yd = 0;
		for(int key : mapx.keySet()) {
			if(key < x) {
				xl+=mapx.get(key);
			}else {
				xr+=mapx.get(key);
			}
		}
		for(int key : mapy.keySet()) {
			if(key < y) {
				yd+=mapy.get(key);
			}else {
				yu+=mapy.get(key);
			}
		}
		int ans = Math.max(xl,Math.max(xr, Math.max(yu, yd)));
		int ansxx = 0, ansxy = 0;
	
		if(xr > xl) {
			ansxx = mapx.higherKey(x);
			ansxy = y;
		}else {
			ansxx = mapx.lowerKey(x);
			ansxy = y;
		}
		
		int ansyx = 0,ansyy = 0;
		if(yu > yd) {
			ansyx = x;
			ansyy = mapy.higherKey(y);
		}else {
			ansyx = x;
			ansyy = mapy.lowerKey(y);
		}
		
		yu = Math.max(yu, yd);
		out.println(ans);
		if(yu > xr) {
			out.print(ansyx+" "+ansyy);
		}else {
			out.print(ansxx+" "+ansxy);
		}
		
		
		
			
		out.close();
	}

	private static void add(TreeMap<Integer, Integer> map, int i) {
		// TODO Auto-generated method stub
		if(map.containsKey(i)) map.put(i, map.get(i)+1);
		else map.put(i, 1);
		
	}
	private static void delete(TreeMap<Integer, Integer> map, int i) {
		if(map.containsKey(i)) {
			if(map.get(i) == 1) map.remove(i);
			else map.put(i, map.get(i)-1);
		}
		
	}
	
	
	
}