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>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>


#define INF             1e9
#define INFL            1e19
#define XX              first
#define YY              second
#define PB              push_back
#define MP              make_pair

#define NEWLINE         cout << endl;
#define HOISE           cerr << "hoise" << endl
#define PAUSE           system("pause")
#define DEBUG(x)        cerr << #x << " = " << x << endl
#define READ            freopen("alu.txt", "r", stdin)
#define WRITE           freopen("vorta.txt", "w", stdout)
#define FASTIO          ios_base::sync_with_stdio(false);cin.tie(NULL)

#define MASK(x)         for(int i = 0; i < 8; i++){ if(x&(1<<i)){ cout << i << " "; } } cout << endl;

typedef long long ll;
typedef pair<int, int > pii;
typedef pair<ll, ll> pll;

const int MAX = 2e5 + 2;
const int MAXLOG = log2(MAX) + 2;
const int MAXN = 1e6 + 2;
const int MOD = 1e9 + 7;
const double PY = acos(-1.0);

int main()
{
//    READ;
//    WRITE;
    FASTIO;

    pii s;
    int n;
    cin >> n;
    vector<pii> p(n);
    cin >> s.XX >> s.YY;
    for(int i = 0; i < n; i++)
        cin >> p[i].XX >> p[i].YY;

    vector<pii> ans(4);
    for(int i = 0; i < 4; i++) ans[i] = MP(0, i);
    for(int i = 0; i < n; i++){
        if(p[i].XX < s.XX) ans[0].XX++; // left
        if(p[i].XX > s.XX) ans[1].XX++; // right
        if(p[i].YY < s.YY) ans[2].XX++; // down
        if(p[i].XX > s.XX) ans[3].XX++; // up
    }
    sort(ans.begin(), ans.end(), greater<pii>());
    cout << ans[0].XX << "\n";
    if(ans[0].YY == 0) cout << s.XX-1 << " " << s.YY;
    if(ans[0].YY == 1) cout << s.XX+1 << " " << s.YY;
    if(ans[0].YY == 2) cout << s.XX << " " << s.YY-1;
    if(ans[0].YY == 3) cout << s.XX << " " << s.YY+1;

    return 0;
}

