#include <iostream>
using namespace std;
int main()
{
int n, m;
int i = 0, j = 0;
int k = 0, q = 0;
cin >> n >> m;
int arr[10][10] = { {0} };
for ( i = 1; i <= n; i++)
{
for ( j = 1; j <= m; j++)
{
cin >> arr[i][j];
}
}
int max = arr[1][1];
for ( i = 1; i <= n; i++)
{
for ( j = 1; j <= m; j++)
{
if (max <= arr[i][j])
{
max = arr[i][j];
}
}
}
for (i = 1; i <= n; i++)
{
for (j = 1; j <= m; j++)
{
if (max == arr[i][j])
{
k = i;
q = j;
}
}
}
cout << k << " " << q << endl;
}
using namespace std;
int main()
{
int n, m;
int i = 0, j = 0;
int k = 0, q = 0;
cin >> n >> m;
int arr[10][10] = { {0} };
for ( i = 1; i <= n; i++)
{
for ( j = 1; j <= m; j++)
{
cin >> arr[i][j];
}
}
int max = arr[1][1];
for ( i = 1; i <= n; i++)
{
for ( j = 1; j <= m; j++)
{
if (max <= arr[i][j])
{
max = arr[i][j];
}
}
}
for (i = 1; i <= n; i++)
{
for (j = 1; j <= m; j++)
{
if (max == arr[i][j])
{
k = i;
q = j;
}
}
}
cout << k << " " << q << endl;
}