


'''simple docstring'''

def __snake_case      (   UpperCAmelCase_		:		Tuple	):
 lowerCamelCase_  				=						[]
 lowerCamelCase_  				=						set({"(", "[", "{"}	)
 lowerCamelCase_  				=						set({")", "]", "}"}	)
 lowerCamelCase_  				=						{"{": "}", "[": "]", "(": ")"}

 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 __snake_case      (   ):
 lowerCamelCase_  				=						input("Enter sequence of brackets: "	)
 if is_balanced(UpperCAmelCase_	):
  print(UpperCAmelCase_      ,       "is balanced"	)
 else:
  print(UpperCAmelCase_      ,       "is not balanced"	)


if __name__ == "__main__":
     main()







'''simple docstring'''

def __snake_case      (   UpperCAmelCase_		:		int = 100	):
 lowerCamelCase_  				=						n * (n + 1) * (2 * n + 1) / 6
 lowerCamelCase_  				=						(n * (n + 1) / 2) ** 2
 return int(square_of_sum - sum_of_squares	)


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



