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
/*
->->->-> Vora Mahammadasim <-<-<-<-
*/
#include<bits/stdc++.h>
#define io std :: ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define Mod 1000000007
#define pb push_back
#define mp make_pair
using namespace std;
int ncr(int n, int r){int p=1,k=1; if (n-r < r) r = n-r; if (r != 0) while (r) { p *= n,k *= r; long long m = __gcd(p, k); p /= m,k /= m,n--,r--; } else p=1; return p;}
int fact(int n){int res = 1, i; for (i = 2; i <= n; i++) res *= i; return res;}
signed main()
{
    io;
    int n,a,b;
    cin>>n>>a>>b;
    int w=0,x=0,y=0,z=0;
    while(n--)
    {
        int p,q;
        cin>>p>>q;
        if(p<a) w++; else x++;
        if(q<b) y++; else z++;
    }
    int mx = max({w,x,y,z});
    cout<<mx<<"\n";
    if(mx == w) cout << a-1 << " " << b;
    else if(mx == x) cout << a+1 << " "<<b;
    else if(mx == y) cout << a+1 << " "<<b-1;
    else if(mx == z) cout << a << " "<< b+1;
}




