


def 				__lowerCamelCase						( UpperCAmelCase_						:		list						):




      """simple docstring"""





      a						:List[Any] 							=       len(UpperCAmelCase_						)
      for i in range(1 ,  UpperCAmelCase_						):
            a						:Union[str, Any] 							=       collection[i]
            a						:List[Any] 							=       0
            a						:Dict 							=       i - 1

            while low <= high:
                  a						:List[Any] 							=       (low + high) // 2
                  if val < collection[mid]:
                        a						:str 							=       mid - 1
                  else:
                        a						:Dict 							=       mid + 1
            for j in range(UpperCAmelCase_ ,  UpperCAmelCase_ ,  -1						):
                  a						:Tuple 							=       collection[j - 1]
            a						:List[Any] 							=       val
      return collection


if __name__ == "__main__":
     snake_case				:    Union[str, Any]       				=     input('''Enter numbers separated by a comma:\n''').strip()
     snake_case				:    Optional[int]       				=     [int(item) for item in user_input.split(''',''')]
     print(binary_insertion_sort(unsorted))









from __future__ import annotations
def 				__lowerCamelCase						( UpperCAmelCase_						:		dict ,  UpperCAmelCase_						:		str						):




      """simple docstring"""





      a							,				a						:Optional[Any] 							=       set(UpperCAmelCase_						), [start]

      while stack:
            a						:Optional[int] 							=       stack.pop()
            explored.add(UpperCAmelCase_						)
            # Differences from BFS:
            # 1) pop last element instead of first one
            # 2) add adjacent elements to stack without exploring them
            for adj in reversed(graph[v]						):
                  if adj not in explored:
                        stack.append(UpperCAmelCase_						)
      return explored


snake_case				:    Optional[int]       				=     {
    '''A''': ['''B''', '''C''', '''D'''],
    '''B''': ['''A''', '''D''', '''E'''],
    '''C''': ['''A''', '''F'''],
    '''D''': ['''B''', '''D'''],
    '''E''': ['''B''', '''F'''],
    '''F''': ['''C''', '''E''', '''G'''],
    '''G''': ['''F'''],
}

if __name__ == "__main__":
     import doctest

     doctest.testmod()
     print(depth_first_search(G, '''A'''))





