




def 					UpperCAmelCase__     (   lowerCamelCase      ):
  lowercase			:Dict							=  len(lowerCamelCase      )
  lowercase			:Optional[Any]							=  len(matrix[0]      )
  lowercase			:Any							=  min(lowerCamelCase,	lowerCamelCase      )

  for row in range(lowerCamelCase      ):
    # Check if diagonal element is not zero
    if matrix[row][row] != 0:
      # Eliminate all the elements below the diagonal
      for col in range(row + 1,	lowerCamelCase      ):
        lowercase			:Optional[int]							=  matrix[col][row] / matrix[row][row]
        for i in range(lowerCamelCase,	lowerCamelCase      ):
          matrix[col][i] -= multiplier * matrix[row][i]
    else:
      # Find a non-zero diagonal element to swap rows
      lowercase			:int							=  True
      for i in range(row + 1,	lowerCamelCase      ):
        if matrix[i][row] != 0:
          lowercase		,			lowercase			:Optional[Any]							=  matrix[i], matrix[row]
          lowercase			:Optional[Any]							=  False
          break
      if reduce:
        rank -= 1
        for i in range(lowerCamelCase      ):
          lowercase			:str							=  matrix[i][rank]

            # Reduce the row pointer by one to stay on the same row
      row -= 1

  return rank


if __name__ == "__main__":
     import doctest

     doctest.testmod()









_UpperCAmelCase		:  Tuple	=   {str(digit): digit**5 for digit in range(10)}



def 					UpperCAmelCase__     (   lowerCamelCase      ):
  return sum(DIGITS_FIFTH_POWER[digit] for digit in str(lowerCamelCase      )      )



def 					UpperCAmelCase__     (   ):
  return sum(
      number
      for number in range(1000,	1000000      )
      if number == digits_fifth_powers_sum(lowerCamelCase      )      )


if __name__ == "__main__":
     print(solution())



