/*模拟退火*/
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<ctime>
using namespace std;
int M,X,Y;
#define Ran 30
#define Run 30
int max(int x,int y)
{
return x>y?x:y;
}
struct node
{
double x,y,d;
}stu[1005],p[30];
double dis(node t)
{
int i;
double mmax=1e10,temp;
for(i=0;i<M;i++)
{
temp=sqrt((double)((stu[i].x-t.x)*(stu[i].x-t.x)+(stu[i].y-t.y)*(stu[i].y-t.y)));
if(temp<mmax)mmax=temp;
}
return mmax;
}
void Solve()
{
int i,j;
double k,delta,eps=0.01;
node tt;
double a,b,temp;
for(i=0;i<Ran;i++)
{
p[i].x=1.0*(rand()%1000+1)/1000.00*X;
p[i].y=1.0*(rand()%1000+1)/1000.00*Y;
p[i].d=dis(p[i]);
}
delta=1.0*max(X,Y)/(1.0*M);
while(delta>eps)
{
for(i=0;i<Ran;i++)
for(j=0;j<Run;j++)
{
a=1.0*(rand()%1000+1)/1000.00*delta;
b=(double)sqrt(delta*delta-a*a);
if(rand()%2==1)a=-a;
if(rand()%2==1)b=-b;
tt.x=p[i].x+a;
tt.y=p[i].y+b;
if(tt.x>=0&&tt.x<=X&&tt.y>=0&&tt.y<=Y)
{
temp=dis(tt);
if(temp>p[i].d)
{
p[i].x=tt.x;
p[i].y=tt.y;
p[i].d=temp;
}
}
}
delta*=0.8;
}
temp=0;
int flag=0;
for(i=0;i<Ran;i++)
if(p[i].d>temp){
flag=i;
temp=p[i].d;
}
printf("The safest point is (%.1lf, %.1lf).\n",p[flag].x,p[flag].y);
}
int main()
{
int cas,i;
scanf("%d",&cas);
while(cas--)
{
scanf("%d%d%d",&X,&Y,&M);
for(i=0;i<M;i++)
scanf("%lf%lf",&stu[i].x,&stu[i].y);
Solve();
}
return 0;
}