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
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace __gnu_pbds;
using namespace __gnu_cxx;
 
typedef pair<int,int> pii;
typedef long long int ll; 
typedef tree<int,null_type,less<int>,rb_tree_tag, \
tree_order_statistics_node_update> ordered_set;
 
#define int ll   
#define long int
#define pb push_back
#define all int i=0; i<n; i++
#define INF 4*1e18

 
#define Nirvana ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl '\n'
 
#define T int _;cin>>_;while(_--)
 
int mod = 1000000007;
long expo(long base, long exp) 
{ 
    long t = 1L; 
    while (exp > 0)  
    { 
        if (exp % 2 != 0)  t = (t * base); 
        base = (base * base);
        exp /= 2; 
    } 
    return t;
} 

int fermat(int a){
    return expo(a, mod-2)%mod;
}
 
#define pow expo

int dp[400][400];
int n, k;

int memo(int i, int j){
	//cout<<i<<" "<<j<<" "<<endl;
	if(dp[i][j] != -1){
		//cout<<i<<" "<<j<<" "<<dp[i][j]<<endl;
		return dp[i][j];
	}
	else if( (i+k)*(i+k) + j*j > n*n && (j+k)*(j+k) + i*i > n*n){
		dp[i][j] = 0;
		//cout<<i<<" "<<j<<" "<<dp[i][j]<<endl;
		return 0;
	}
	else{
		if(memo(i+k, j)==0 || memo(i, j+k)==0){
			dp[i][j] = 1;
		}
		else{
			dp[i][j] = 0;
		}
		//cout<<i<<" "<<j<<" "<<dp[i][j]<<endl;
		return dp[i][j];
	}
	//return dp[i][j];
}

signed main(){
	int n, x, y;
	cin>>n>>x>>y;
	
	int q[4] = {0, 0, 0, 0};
	
	for(int k=0; k<n; k++){
		int i, j;
		cin>>i>>j;
		
		i-=x;
		j-=y;
		
		if(i>=0 && j>=0){
			q[0]++;
		}
		if(i<=0 && j<=0){
			q[2]++;
		}
		if(i>=0 && j<=0){
			q[3]++;
		}
		if(i<=0 && j>=0){
			q[1]++;
		}
	}
	int maxi = 0;	
	for(int i=0; i<4; i++){
		for(int j=0; j<4; j++){
			if(j==i-1 || j==i+1){
				maxi = max(maxi, q[i]+q[j]);
			}
		}
	}
	cout<<maxi<<endl;
	
	if(q[0] + q[1] == maxi){
		cout<<x<<" "<<y+1<<endl;
	}
	else if(q[1] + q[2] == maxi){
		cout<<x-1<<" "<<y<<endl;
	}
	else if(q[2] + q[3] == maxi){
		cout<<x<<" "<<y-1<<endl;
	}
	else if(q[3] + q[1] == maxi){
		cout<<x+1<<" "<<y<<endl;
	}
}
    
