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>
const int nmax = 1025;
const int mod = 9973;
const long long inf = 0x3f3f3f3f3f3f3f3f;
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, x, y;
  cin >> n >> x >> y;
  vector<pair<int, int> > v;
  int min = 2000000000, pos, xf, yf;
  for (int i = 0; i < int(n); i++) {
    int a, b;
    cin >> a >> b;
    b *= -1;
    v.push_back(make_pair(a, b));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < int(n); i++) {
    int aux = abs(x - v[i].first) + abs(y - v[i].second);
    if (aux <= min) {
      min = aux;
      pos = i + 1;
    }
  }
  cout << pos << "\n";
  cout << v[pos - 1].first << " " << v[pos - 1].second * -1;
}
