


_A		:					int          =							float('''inf''')



class 							a       :





     def __init__(     self       :					List[str]     ,						SCREAMING_SNAKE_CASE_       :					Optional[Any]				):
        __lowerCamelCase:					Optional[Any]	 =						[0] * n
        __lowerCamelCase:					Optional[int]	 =						[0] * n
        __lowerCamelCase:					Dict	 =						[0] * n
        __lowerCamelCase:					Union[str, Any]	 =						[[] for _ in range(SCREAMING_SNAKE_CASE_				)]





     def 			SCREAMING_SNAKE_CASE__							(     self       :					Any     ,						SCREAMING_SNAKE_CASE_       :					str     ,						SCREAMING_SNAKE_CASE_       :					List[str]     ,						SCREAMING_SNAKE_CASE_       :					List[str]     ,						SCREAMING_SNAKE_CASE_       :					Optional[Any]=0				):
        self.adj[a].append([b, len(self.adj[b]				), c, 0]				)
        self.adj[b].append([a, len(self.adj[a]				) - 1, rcap, 0]				)





     def 			SCREAMING_SNAKE_CASE__							(     self       :					str     ,						SCREAMING_SNAKE_CASE_       :					Optional[Any]     ,						SCREAMING_SNAKE_CASE_       :					List[Any]     ,						SCREAMING_SNAKE_CASE_       :					List[str]				):
        if vertex == sink or not flow:
           return flow

        for i in range(self.ptr[vertex]     ,						len(self.adj[vertex]				)				):
           __lowerCamelCase:					Any	 =						self.adj[vertex][i]
           if self.lvl[e[0]] == self.lvl[vertex] + 1:
              __lowerCamelCase:					List[str]	 =						self.depth_first_search(e[0]     ,						SCREAMING_SNAKE_CASE_     ,						min(SCREAMING_SNAKE_CASE_     ,						e[2] - e[3]				)				)
              if p:
                 self.adj[vertex][i][3] += p
                 self.adj[e[0]][e[1]][3] -= p
                 return p
           __lowerCamelCase:					List[str]	 =						self.ptr[vertex] + 1
        return 0







     def 			SCREAMING_SNAKE_CASE__							(     self       :					Tuple     ,						SCREAMING_SNAKE_CASE_       :					Any     ,						SCREAMING_SNAKE_CASE_       :					List[Any]				):
        __lowerCamelCase ,  __lowerCamelCase:					Optional[Any]	 =						0, source
        for l in range(31				):  # noqa: E741  l = 30 maybe faster for random data
           while True:
              __lowerCamelCase ,  __lowerCamelCase:					str	 =						[0] * len(self.q				), [0] * len(self.q				)
              __lowerCamelCase ,  __lowerCamelCase ,  __lowerCamelCase:					str	 =						0, 1, 1
              while qi < qe and not self.lvl[sink]:
                 __lowerCamelCase:					Optional[int]	 =						self.q[qi]
                 qi += 1
                 for e in self.adj[v]:
                    if not self.lvl[e[0]] and (e[2] - e[3]) >> (30 - l):
                       __lowerCamelCase:					str	 =						e[0]
                       qe += 1
                       __lowerCamelCase:					Dict	 =						self.lvl[v] + 1

              __lowerCamelCase:					List[str]	 =						self.depth_first_search(SCREAMING_SNAKE_CASE_     ,						SCREAMING_SNAKE_CASE_     ,						SCREAMING_SNAKE_CASE_				)
              while p:
                 flow += p
                 __lowerCamelCase:					Tuple	 =						self.depth_first_search(SCREAMING_SNAKE_CASE_     ,						SCREAMING_SNAKE_CASE_     ,						SCREAMING_SNAKE_CASE_				)

              if not self.lvl[sink]:
                 break

        return flow
_A		:					List[str]          =							Dinic(10)
_A		:					Optional[Any]          =							0
_A		:					Optional[Any]          =							9
for vertex in range(1, 5):
   graph.add_edge(source, vertex, 1)
for vertex in range(5, 9):
   graph.add_edge(vertex, sink, 1)
for vertex in range(1, 5):
   graph.add_edge(vertex, vertex + 4, 1)

# Now we can know that is the maximum flow(source -> sink)
print(graph.max_flow(source, sink))






from string import ascii_uppercase



def      __lowerCAmelCase    (				snake_case						:     str    ,   snake_case						:     str    ,   snake_case						:     bool = False    ,   snake_case						:     str = ascii_uppercase			)							->				str:
   __lowerCamelCase:					List[str]	 =						keyword.upper()
   __lowerCamelCase:					Tuple	 =						plaintext.upper()
   __lowerCamelCase:					Optional[Any]	 =						set(snake_case			)

   # create a list of unique characters in the keyword - their order matters
   # it determines how we will map plaintext characters to the ciphertext
   __lowerCamelCase:					Tuple	 =						[]
   for char in keyword:
      if char in alphabet_set and char not in unique_chars:
         unique_chars.append(snake_case			)
    # the number of those unique characters will determine the number of rows
   __lowerCamelCase:					Tuple	 =						len(snake_case			)

   # create a shifted version of the alphabet
   __lowerCamelCase:					List[str]	 =						unique_chars + [
       char for char in alphabet if char not in unique_chars
   ]

   # create a modified alphabet by splitting the shifted alphabet into rows
   __lowerCamelCase:					List[str]	 =						[
       shifted_alphabet[k : k + num_unique_chars_in_keyword]
       for k in range(0    ,   26    ,   snake_case			)
   ]

   # map the alphabet characters to the modified alphabet characters
   # going 'vertically' through the modified alphabet - consider columns first
   __lowerCamelCase:					Union[str, Any]	 =						{}
   __lowerCamelCase:					str	 =						0
   for column in range(snake_case			):
      for row in modified_alphabet:
         # if current row (the last one) is too short, break out of loop
         if len(snake_case			) <= column:
            break

         # map current letter to letter in modified alphabet
         __lowerCamelCase:					Union[str, Any]	 =						row[column]
         letter_index += 1

   if verbose:
      print(snake_case			)
   # create the encrypted text by mapping the plaintext to the modified alphabet
   return "".join(mapping[char] if char in mapping else char for char in plaintext			)


if __name__ == "__main__":
   # example use
   print(mixed_keyword('''college''', '''UNIVERSITY'''))


