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.*;
public class Main
{
    public static class pair{
        int x;
        int y;
        public pair(int a,int b)
        {
            x=a;
            y=b;
        }
        @Override
        public boolean equals(Object o)
        {
            if(this==o)
            return true;
            pair p=(pair)o;
            if(o==null)
            return false;
            if(this.x==p.x&&this.y==p.y)
            return true;
            return false;
        }
        @Override
        public int hashCode()
        {
            return Objects.hash(this.x,this.y);
        }
    }
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
	    int z1=sc.nextInt();
	    int z2=sc.nextInt();
	    HashMap<pair,Integer> map=new HashMap();
	    ArrayList<pair> list=new ArrayList();
	    for(int i=0;i<n;i++)
	    {
	        pair p=new pair(sc.nextInt(),sc.nextInt());
	        if(map.containsKey(p))
	        map.replace(p,map.get(p)+1);
	        else
	        {
	            map.put(p,1);
	            list.add(p);
	        }
	    }
	    int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0;
	    for(pair p:list)
	    {
	        if(p.x==z1)
	        {
	            if(p.y>z2)
	            a+=map.get(p);
	            else
	            e+=map.get(p);
	        }
	        else if(p.x>z1)
	        {
	            if(p.y==z2)
	                c+=map.get(p);
	            else if(p.y>z2)
	                b+=map.get(p);
	            else
	            d+=map.get(p);
	        }
	        else
	        {
	            if(p.y==z2)
	                g+=map.get(p);
	            else if(p.y>z2)
	                h+=map.get(p);
	            else
	             f+=map.get(p);
	        }
	    }
	    long ans=0;
	    int p1=z1,p2=z2;
	    if(a+b+h>ans)
	    {
	        if(z2+1<=1000000000)
	        {
	            ans=a+b+h;
	            p1=z1;
	            p2=z2+1;
	        }
	    }
	    if(c+b+d>ans)
	    {
	        if(z1+1<=1000000000)
	        {
	            ans=c+b+d;
	            p1=z1+1;
	            p2=z2;
	        }
	    }
	    if(e+d+f>ans)
	    {
	        if(z2-1>=0)
	        {
	            ans=e+d+f;
	            p1=z1;
	            p2=z2-1;
	        }
	    }
	    if(f+g+h>ans)
	    {
	        if(z1-1>=0)
	        {
	            ans=f+g+h;
	            p1=z1-1;
	            p2=z2;
	        }
	    }
	    System.out.println(ans+"\n"+p1+" "+p2);
	    
	}
}
