




def 							_UpperCAmelCase  (UpperCamelCase_ : Union[str, Any]       ):
				'''simple docstring'''
				_lowerCAmelCase    :    int										=      []
				_lowerCAmelCase    :    Dict										=      set({"""(""", """[""", """{"""}       )
				_lowerCAmelCase    :    int										=      set({""")""", """]""", """}"""}       )
				_lowerCAmelCase    :    Tuple										=      {"""{""": """}""", """[""": """]""", """(""": """)"""}

				for i in range(len(UpperCamelCase_       )       ):
								if s[i] in open_brackets:
												stack.append(s[i]       )

								elif s[i] in closed_brackets and (
								    len(UpperCamelCase_       ) == 0 or (len(UpperCamelCase_       ) > 0 and open_to_closed[stack.pop()] != s[i])
								):
												return False

				return len(UpperCamelCase_       ) == 0




def 							_UpperCAmelCase  ():
				'''simple docstring'''
				_lowerCAmelCase    :    Optional[Any]										=      input("""Enter sequence of brackets: """       )
				if is_balanced(UpperCamelCase_       ):
								print(UpperCamelCase_      ,    """is balanced"""       )
				else:
								print(UpperCamelCase_      ,    """is not balanced"""       )


if __name__ == "__main__":
	main()







def 							_UpperCAmelCase  (UpperCamelCase_ : str      ,    UpperCamelCase_ : bool = False       ):
				'''simple docstring'''

				if not isinstance(UpperCamelCase_      ,    UpperCamelCase_       ):
								_lowerCAmelCase    :    Tuple										=      F"Expected string as input, found {type(UpperCamelCase_       )}"
								raise ValueError(UpperCamelCase_       )
				if not isinstance(UpperCamelCase_      ,    UpperCamelCase_       ):
								_lowerCAmelCase    :    Optional[Any]										=      F"Expected boolean as use_pascal parameter, found {type(UpperCamelCase_       )}"
								raise ValueError(UpperCamelCase_       )

				_lowerCAmelCase    :    Any										=      input_str.split("""_"""       )

				_lowerCAmelCase    :    str										=      0 if use_pascal else 1

				_lowerCAmelCase    :    Any										=      words[start_index:]

				_lowerCAmelCase    :    List[str]										=      [word[0].upper() + word[1:] for word in words_to_capitalize]

				_lowerCAmelCase    :    Any										=      """""" if use_pascal else words[0]

				return "".join([initial_word, *capitalized_words]       )


if __name__ == "__main__":
	from doctest import testmod

	testmod()

