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>
#include <ext/pb_ds/assoc_container.hpp> 
 
using namespace std;
using namespace __gnu_pbds; 
#define     mod             1e9+7
#define     MOD             998244353
#define     ll              long long
#define     mp              make_pair
#define     F               first
#define     S               second
#define     t()             int test;cin>>test;while(test--)
#define     ii              pair<int,int>
#define     que_max         priority_queue <int>
#define     IOS             ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define     endl            "\n"
typedef tree< int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
 
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif
 
 
 
 
int32_t main()
 
{  
    #ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    #endif
 
    IOS;
   
    int n, xi, yi;

    cin >>n >> xi >> yi;

    vector<int> uppr_x, low_x, upper_y, low_y, samex, samey;

    while(n--)
    {
        int u, v;

        cin>>u >> v;

        if(u > xi)
        {
            uppr_x.push_back(u);
        }
        else if( u <xi)
        {
            low_x.push_back(u);
        }
        else
        {
            samex.push_back(u);
        }

        if(v > yi)
        {
            upper_y.push_back(v);
        }
        else if(v < yi)
        {
            low_y.push_back(v);
        }
        else
        {
            samey.push_back(v);
        }
    }

    int szx1 = uppr_x.size(), szx2 = low_x.size(), szy1 = upper_y.size(), szy2 = low_y.size();
   
    int x, y, cntx=0, cnty=0;

    if((int)samex.size())
    {
        x = samex[0];
        cntx += (int)samex.size();

        cntx += max(szx1, szx2);

        if(szy1 > szy2)
        {
             y = *min_element(upper_y.begin(), upper_y.end());
        }
         else
        {
             y = *max_element(low_y.begin(), low_y.end());
        }
         cnty = max(szy1, szy2);
    }
    else if((int)samey.size())
    {
        y = samey[0];
        cnty += (int)samey.size();

        cnty += max(szy1, szy2);
         if(szx1 > szx2)
        {
            x = *min_element(uppr_x.begin(), uppr_x.end());
        }
        else
        {
            x = *max_element(low_x.begin(), low_x.end());
        }
        cntx = max(szx1, szx2);
    }
    else
    {
         if(szx1 > szx2)
        {
            x = *min_element(uppr_x.begin(), uppr_x.end());
        }
        else
        {
            x = *max_element(low_x.begin(), low_x.end());
        }
        if(szy1 > szy2)
        {
             y = *min_element(upper_y.begin(), upper_y.end());
        }
         else
        {
             y = *max_element(low_y.begin(), low_y.end());
        }

        cntx = max(szx1, szx2);
        cnty = max(szy1, szy2);
    }

    cout<<min(cntx, cnty)<<endl;

    cout<<x<<" "<<y<<endl;

   
 
 
}
            
 