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
import java.io.*;
import java.util.*;

public class HelloWorld
{

  public static void main(String[] args) throws Exception
  {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter writer = new PrintWriter(System.out);
    StringTokenizer st = new StringTokenizer(br.readLine());
    int n = Integer.parseInt(st.nextToken());
    int sx = Integer.parseInt(st.nextToken());
    int sy = Integer.parseInt(st.nextToken());
    int[] A = new int[n];
    int[] B = new int[n];
    for(int i = 0; i < n; i++)
    {
      st = new StringTokenizer(br.readLine());
      A[i] = Integer.parseInt(st.nextToken());
      B[i] = Integer.parseInt(st.nextToken());
    }
    ArrayList<Integer> ls1 = new ArrayList<>();
    ArrayList<Integer> ls2 = new ArrayList<>();
    ls1.add(sx);
    ls2.add(sy);
    for(int i = 0; i < n; i++)
    {
      if(A[i] != sx) ls1.add(A[i]);
      if(B[i] != sy) ls2.add(B[i]);
    }
    Collections.sort(ls1);
    Collections.sort(ls2);
    int index1 = -1;
    int index2 = -1;
    for(int i = 0; i < ls1.size(); i++)
    {
      if(ls1.get(i) == sx)
      {
        index1 = i;
        break;
      }
    }
    for(int i = 0; i < ls2.size(); i++)
    {
      if(ls2.get(i) == sy)
      {
        index2 = i;
        break;
      }
    }
    int count1 = index1;
    int count2 = ls1.size()-index1-1;
    int max = -1;
    int val = -1;
    if(count1 != 0 && count2 != 0)
    {
      if(count1 >= count2)
      {
        max = count1;
        val = ls1.get(index1-1);
      }
      else
      {
        max = count2;
        val = ls1.get(index1+1);
      }
    }
    if(count1 != 0 && count2 == 0)
    {
      max = count1;
      val = ls1.get(index1-1);
    }
    if(count1 == 0 && count2 != 0)
    {
      max = count2;
      val = ls1.get(index1+1);
    }
    int count3 = index2;
    int count4 = ls2.size()-index2-1;
    int max1 = -1;
    int val1 = -1;
    if(count3 != 0 && count4 != 0)
    {
      if(count3 >= count4)
      {
        max1 = count3;
        val1 = ls2.get(index2-1);
      }
      else
      {
        max1 = count4;
        val1 = ls2.get(index2+1);
      }
    }
    if(count3 != 0 && count4 == 0)
    {
      max1 = count3;
      val1 = ls2.get(index2-1);
    }
    if(count3 == 0 && count4 != 0)
    {
      max1 = count4;
      val1 = ls2.get(index2+1);
    }
    if(max >= max1)
    {
      writer.println(max);
      writer.println(val+" "+sy);
    }
    else
    {
      writer.println(max1);
      writer.println(sx+" "+val1);
    }
    br.close();
    writer.close();
  }

}
