#include <iostream>
#include <bits/stdc++.h>
#include <string>
using namespace std;
typedef struct
{
int x;int y;int dis;int no;
}XY;
int dis(XY temp,XY user)
{
return pow(temp.x-user.x,2)+pow(temp.y-user.y,2);
}
bool cmp(XY a,XY b)
{
if(a.dis<b.dis)
return true;
else if(a.dis==b.dis)
{
if(a.no<b.no)
return true;
else
return false;
}
else
return false;
}
int main()
{
XY user,temp;
int number;
cin>>number>>user.x>>user.y;
vector<XY> xy;
for(int i=0;i<number;i++)
{
cin>>temp.x>>temp.y;
temp.no=i+1;
temp.dis=dis(temp,user);
xy.push_back(temp);
}
sort(xy.begin(),xy.end(),cmp);
for(int i=0;i<3;i++)
{
cout<<xy[i].no<<endl;
}
}