#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iomanip>
using namespace std;
//英语 看博友分析有图 抄博友程序 几何 背
struct point{
double x;
double y;
};
struct nod{
double l;
double r;
};
double dis(point a, point b)
{
return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
bool cmp(nod a,nod b)
{
return a.l<b.l;
}
int main()
{
while(1)
{
int n;
//cin>>n;
scanf("%d",&n);
if(n==0)
{
break;
}
point p;
//cin>>p.x>>p.y;
scanf("%lf%lf",&p.x,&p.y);
vector<nod> ve;
for(int i=0;i<n;i++)
{
double r;
point q;
//cin>>q.x>>q.y>>r;
scanf("%lf%lf%lf",&q.x,&q.y,&r);
double d=dis(p,q);
double a=asin(r/d);
double b=asin((p.x-q.x)/d);
double j1=a+b;
double j2=b-a;
nod t;
t.l=p.x-tan(j1)*p.y;
t.r=p.x-tan(j2)*p.y;
ve.push_back(t);
}
sort(ve.begin(),ve.end(),cmp);
double L=ve[0].l;
double R=ve[0].r;
for(int i=1;i<n;i++)
{
if(ve[i].l>R)
{
cout<<fixed<<setprecision(2)<<L<<" "<<R<<endl;
L=ve[i].l;
R=ve[i].r;
}else
{
R=max(R,ve[i].r);
}
}
cout<<fixed<<setprecision(2)<<L<<" "<<R<<endl<<endl;
}
return 0;
}