#include
void findMax(int(*p)[100] , int a,int b, int*pr , int*pc)
{
int max = p[0][0];
int i,j;
for(i=0;i {
for(j=0;j {
if(max < p[i][j])
{
max = p[i][j];
*pr = i;
*pc = j;
}
}
}
(*pr)++;
(*pc)++;
}
int main()
{
int t;
int a,b;
int martix[100][100];
int i,j;
int r,c;
scanf("%d",&t);
for(;t;t--)
{
scanf("%d",&a);
scanf("%d",&b);
for(i=0;i {
for(j=0;j {
scanf("%d",&martix[i][j]);
}
}
findMax(martix,a,b,&r,&c);
printf("%d %d",r,c);
}
return 0;
}