import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] nm = br.readLine().split(" "); int n = Integer.parseInt(nm[0]); int m = Integer.parseInt(nm[1]); int[][] array = new int[n][m]; int x = 0, y = 0; int max = array[x][y]; for (int i = 0; i < n; i++) { String[] arr = br.readLine().split(" "); for (int j = 0; j < m; j++) { array[i][j] = Integer.parseInt(arr[j]); if (array[i][j] > max) { max = array[i][j]; x = i; y = j; } } } System.out.printf("%d %d", x + 1, y + 1); } }