text: Code:
  n, m = [int(i) for i in input().split()]
  a = [[int(j) for j in input().split()] for i in range(n)]
  best_i, best_j = 0, 0
  curr_max = a[0][0]
  for i in range(n):
      for j in range(m):
          if a[i][j] > curr_max:
              curr_max = a[i][j]
              best_i, best_j = i, j
  print(best_i, best_j)