




"""simple docstring"""


def  UpperCAmelCase__	(snake_case__							: int   ):
  """simple docstring"""

  _snake_case							:		Optional[Any]								=  (1 + 24 * n) ** 0.5
  return ((1 + root) / 6) % 1 == 0


def  UpperCAmelCase__	(snake_case__							: int = 50_00   ):
  """simple docstring"""

  _snake_case							:		List[str]								=  [(i * (3 * i - 1)) // 2 for i in range(1		,       snake_case__   )]
  for i, pentagonal_i in enumerate(snake_case__   ):
    for j in range(snake_case__		,       len(snake_case__   )   ):
      _snake_case							:		Dict								=  pentagonal_nums[j]
      _snake_case							:		Optional[Any]								=  pentagonal_i + pentagonal_j
      _snake_case							:		List[str]								=  pentagonal_j - pentagonal_i
      if is_pentagonal(snake_case__   ) and is_pentagonal(snake_case__   ):
        return b

  return -1


if __name__ == "__main__":
     print(F'''{solution() = }''')








"""simple docstring"""


def  UpperCAmelCase__	(snake_case__							: Optional[Any]   ):
  """simple docstring"""

  _snake_case							:		Union[str, Any]								=  []
  _snake_case							:		Dict								=  set({"""(""", """[""", """{"""}   )
  _snake_case							:		Union[str, Any]								=  set({""")""", """]""", """}"""}   )
  _snake_case							:		Tuple								=  {"""{""": """}""", """[""": """]""", """(""": """)"""}

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

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

  return len(snake_case__   ) == 0


def  UpperCAmelCase__	():
  """simple docstring"""

  _snake_case							:		Any								=  input("""Enter sequence of brackets: """   )
  if is_balanced(snake_case__   ):
    print(snake_case__		,       """is balanced"""   )
  else:
    print(snake_case__		,       """is not balanced"""   )


if __name__ == "__main__":
     main()


