input: from typing import List
  
  def replace_negatives(matrix: List[List[int]]) -> List[List[int]]:
      """
      For a given 0-indexed m x n integer matrix, generate a new matrix named result. Initially set result equal to matrix, then whenever an element is -1, substitute it with the highest element in its column.
  
      Return the result matrix.
  
      Examples:
      >>> matrix = [[1,2,-1],[4,-1,6],[7,8,9]]
      [[1,2,9],[4,8,6],[7,8,9]]
      >>> matrix = [[3,-1],[5,2]]
      [[3,2],[5,2]]
  
      Constraints:
      m == matrix.length
      n == matrix[i].length
      2 <= m, n <= 50
      -1 <= matrix[i][j] <= 100
      The input is guaranteed such that each column contains at least one non-negative integer.
      """
output:     result = [[matrix[i][j] for j in range(len(matrix[0]))] for i in range(len(matrix))]
  
      for j in range(len(matrix[0])):
          max_val = float('-inf')
          for i in range(len(matrix)):
              if matrix[i][j] != -1:
                  max_val = max(max_val, matrix[i][j])
          
          for i in range(len(matrix)):
              if matrix[i][j] == -1:
                  result[i][j] = max_val
  
      return result