




'''simple docstring'''

def 						UpperCamelCase    (							_lowerCamelCase : str	):
    A__    =      0

    # if input_string is "aba" than new_input_string become "a|b|a"
    A__    =      """"""
    A__    =      """"""

    # append each character + "|" in new_string for range(0, length-1)
    for i in input_string[: len(_lowerCamelCase	) - 1]:
        new_input_string += i + "|"
    # append last character
    new_input_string += input_string[-1]

    # we will store the starting and ending of previous furthest ending palindromic
    # substring
    A__    =      0, 0

    # length[i] shows the length of palindromic substring with center i
    A__    =      [1 for i in range(len(_lowerCamelCase	)	)]

    # for each character in new_string find corresponding palindromic string
    A__    =      0
    for j in range(len(_lowerCamelCase	)	):
        A__    =      1 if j > r else min(length[l + r - j] // 2						,	r - j + 1	)
        while (
            j - k >= 0
            and j + k < len(_lowerCamelCase	)
            and new_input_string[k + j] == new_input_string[j - k]
        ):
            k += 1

        A__    =      2 * k - 1

        # does this string is ending after the previously explored end (that is r) ?
        # if yes the update the new r to the last index of this
        if j + k - 1 > r:
            A__    =      j - k + 1  # noqa: E741
            A__    =      j + k - 1

        # update max_length and start position
        if max_length < length[j]:
            A__    =      length[j]
            A__    =      j

             # create that string
    A__    =      new_input_string[start - max_length // 2 : start + max_length // 2 + 1]
    for i in s:
        if i != "|":
            output_string += i

    return output_string


if __name__ == "__main__":
  import doctest

  doctest.testmod()










'''simple docstring'''

def 						UpperCamelCase    (							_lowerCamelCase : List[Any]						,	_lowerCamelCase : List[str]						,	_lowerCamelCase : List[str]						,	_lowerCamelCase : Tuple	):
    # Return True if there is node that has not iterated.
    A__    =      [False] * len(_lowerCamelCase	)
    A__    =      []
    queue.append(_lowerCamelCase	)
    A__    =      True

    while queue:
        A__    =      queue.pop(0	)
        for ind in range(len(graph[u]	)	):
            if visited[ind] is False and graph[u][ind] > 0:
                queue.append(_lowerCamelCase	)
                A__    =      True
                A__    =      u

    return visited[t]





def 						UpperCamelCase    (							_lowerCamelCase : Optional[Any]						,	_lowerCamelCase : Optional[Any]						,	_lowerCamelCase : Optional[int]	):
    # This array is filled by BFS and to store path
    A__    =      [-1] * (len(_lowerCamelCase	))
    A__    =      0
    while bfs(_lowerCamelCase						,	_lowerCamelCase						,	_lowerCamelCase						,	_lowerCamelCase	):
        A__    =      float("Inf"	)
        A__    =      sink

        while s != source:
            # Find the minimum value in select path
            A__    =      min(_lowerCamelCase						,	graph[parent[s]][s]	)
            A__    =      parent[s]

        max_flow += path_flow
        A__    =      sink

        while v != source:
            A__    =      parent[v]
            graph[u][v] -= path_flow
            graph[v][u] += path_flow
            A__    =      parent[v]
    return max_flow


__lowerCAmelCase							:     Any		     =[
    [0, 16, 13, 0, 0, 0],
    [0, 0, 10, 12, 0, 0],
    [0, 4, 0, 0, 14, 0],
    [0, 0, 9, 0, 0, 20],
    [0, 0, 0, 7, 0, 4],
    [0, 0, 0, 0, 0, 0],
]

__lowerCAmelCase     ,					__lowerCAmelCase							:     int		     =0, 5



print(ford_fulkerson(graph, source, sink))



