
__magic_name__  :  Optional[Any]     			=   [
    [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0],
]





def        lowerCAmelCase       (				snake_case__   :      int				,					snake_case__   :      Union[str, Any]				,					snake_case__   :      Tuple				,					snake_case__   :      List[Any] )->			bool:
    return 0 <= row < rows and 0 <= col < cols





def        lowerCAmelCase       (				snake_case__   :      Any				,					snake_case__   :      str				,					snake_case__   :      Dict				,					snake_case__   :      Any )->			int:
    A_								=					len(__lowerCAmelCase )
    A_								=					len(mat[0] )
    if is_safe(__lowerCAmelCase				,					__lowerCAmelCase				,					__lowerCAmelCase				,					__lowerCAmelCase ) and (row, col) not in seen and mat[row][col] == 1:
        seen.add((row, col) )
        return (
            1
            + depth_first_search(row + 1				,					__lowerCAmelCase				,					__lowerCAmelCase				,					__lowerCAmelCase )
            + depth_first_search(row - 1				,					__lowerCAmelCase				,					__lowerCAmelCase				,					__lowerCAmelCase )
            + depth_first_search(__lowerCAmelCase				,					col + 1				,					__lowerCAmelCase				,					__lowerCAmelCase )
            + depth_first_search(__lowerCAmelCase				,					col - 1				,					__lowerCAmelCase				,					__lowerCAmelCase )
        )
    else:
        return 0





def        lowerCAmelCase       (				snake_case__   :      Optional[int] )->			int:
    A_								=					set()

    A_								=					0
    for row, line in enumerate(__lowerCAmelCase ):
        for col, item in enumerate(__lowerCAmelCase ):
            if item == 1 and (row, col) not in seen:
                # Maximizing the area
                A_								=					max(__lowerCAmelCase				,					depth_first_search(__lowerCAmelCase				,					__lowerCAmelCase				,					__lowerCAmelCase				,					__lowerCAmelCase ) )
    return max_area


if __name__ == "__main__":
     import doctest

     print(find_max_area(matrix))  # Output -> 6
     doctest.testmod()














def __A       ( __lowerCAmelCase = 100					,						__lowerCAmelCase = 100      )->    int:





						"""simple docstring"""



						return max(
						    sum(int(__lowerCAmelCase      ) for x in str(base**power      )      )
						    for base in range(__lowerCAmelCase      )
						    for power in range(__lowerCAmelCase      )      )


# Tests
if __name__ == "__main__":
		import doctest

		doctest.testmod()
