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;
using ll = long long int;
using dl = double;
const int N = 2e5 + 10;
ll aarray[200000 + 10];
ll magic[101][101];
vector<pair<ll, ll>> v1, v2;
bool prime[1000001];
int main() {
  ios_base::sync_with_stdio(false);
  string str;
  ll i, j, n, m, k, x, y, t, a, b;
  cin >> n >> x >> y;
  for (i = 1; i <= n; i++) {
    cin >> a >> b;
    if (a < x) {
      v1.push_back(make_pair(a, b));
    } else {
      v2.push_back(make_pair(a, b));
    }
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  if (v1.size() > v2.size()) {
    cout << v1.size() << endl;
    auto it = v1.end();
    it--;
    cout << it->first << " " << it->second << endl;
  } else {
    cout << v2.size() << endl;
    auto it = v2.begin();
    cout << it->first << " " << it->second << endl;
  }
  return 0;
}
